Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by BrianAtWork

  1. BrianAtWork

    Track down 'Subroutine SomeSubName redefined...' warning

    I thought I remembered something like this in my Perl Hacks book... Hack #74 says to use Devel::TraceUse Like this: perl -MDevel::TraceUse myscript.pl And gives output something like this: Modules used from myscript.pl: 1. strict 1.03, myscript.pl line 2 [main] 2. warnings 1.03...
  2. BrianAtWork

    How to handle binary data in Perl?

    Which Database server are you using? I'm guessing either SQL Server or SyBase. I was reading the DBI documentation (http://search.cpan.org/~timb/DBI-1.605/DBI.pm#Handling_BLOB_/_LONG_/_Memo_Fields). Apparently you can set $dbh->{LongReadLen} or $dbh->{LongTruncOk} (to truncate long data)...
  3. BrianAtWork

    Perl Reg exp: Parentheses in character class

    Try something like this to see what I was talking about: $line = 'hello(()())'; @captures = $line =~ /([\(\)]*)/g; #added the "g" flag for global print "$_\n" foreach (@captures);
  4. BrianAtWork

    Perl Reg exp: Parentheses in character class

    I got to my Unix box and tested it - I see what was happening. It was the fault of the star, I believe. The star says "match zero or more". The letter "h" in your string "hello" matches "zero or more" parenthesis, so $1 was '' - it matched the "h" but didn't capture anything. The plus sign...
  5. BrianAtWork

    Perl Reg exp: Parentheses in character class

    I think your star is not being greedy enough? Try changing your "*" to a "+" and see if you get better results.
  6. BrianAtWork

    How to handle binary data in Perl?

    Not sure about the data-conversion error. I would try running your query outside of Perl and see if you get the error or not.
  7. BrianAtWork

    How to handle binary data in Perl?

    Your second one should be printing to STDOUT instead of OUTF if you want to see it on the screen. Are you seeing multiple "TESTING" lines appear on your screen? If so, something seems a little off - Your query is "select Audio_Data from English_English where Audio_Name = 'ENG_2.WAV'" - I would...
  8. BrianAtWork

    How to handle binary data in Perl?

    Maybe you have done this, but I would make sure you are getting something returned from your database query. Maybe inside your while loop, inside your foreach loop, do: while(@first = $sth->fetchrow_array) { foreach $field(@first) { print STDOUT "TESTING\n"; print OUTF...
  9. BrianAtWork

    modified date and size of a file

    Try adding this line: if ( ! -e $filefull ) { print "$filefull does not exist\n"; } if ( ! -r $filefull ) { print "$filefull is not readable\n"; }
  10. BrianAtWork

    modified date and size of a file

    Does the user that the http server is using have permissions on the files or the directory that the files are in? Do all of the files get the exact same time and size=0?
  11. BrianAtWork

    modified date and size of a file

    There could be a problem with this line: my ($day, $month, $day, $time, $year) = split(/ /, $j); You are using $day twice. I also prefer to use POSIX and then get my date string like this: use POSIX; my $md = strftime("%d %b %H:%M", localtime($m)); Just a preference though
  12. BrianAtWork

    New To Rails - Date Format Help

    Sounds like you need the strftime function? Not exactly sure how you are handling this date, but if you had it in a variable called createdDate, then try this: createdDate.strftime("Created Date: %m/%d/%Y at %I:%M%p")
  13. BrianAtWork

    DBD::mysql again...

    What OS are you trying to build DBD::mysql on? Is the MySQL client already installed and working (outside of perl)? If so, where are the MySQL libraries (ex. /usr/local/mysql/lib)? You may have to tell the Makefile.PL where the MySQL libraries are located. The "Referenced Symbol not found"...
  14. BrianAtWork

    Convert Perl Number to Text Representation. For checks

    Have you checked out the Lingua::EN::Numbers module? (Assuming you need English) use Lingua::EN::Numbers qw(num2en num2en_ordinal); my $x = 234; my $y = 54; print "You have ", num2en($x), " things to do today!\n"; print "You will stop caring after the ", num2en_ordinal($y), ".\n"...
  15. BrianAtWork

    Perl Flock and Aix 5.3?

    I'm on AIX 5.3 and it worked for me. What part is not working? Is it dying on "Cannot open..." or is it exiting with a 1 inside your unless statement?

Part and Inventory Search

Back
Top