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!

Search results for query: *

  1. ishnid

    HTTP::Date - Only first two functions exported by default

    If you wanted to use it without importing it, you could do, for example: my $parsed_date = HTTP::Date::parse_date( $raw_date );
  2. ishnid

    Return value from subroutine

    How about: $x = sub() || $x; That would maintain the pre-existing value of $x in the event that sub() returns a false value.
  3. ishnid

    Perl Script to Loop through Files

    Probably slightly safer to use word boundaries too. perl -pi'.bak' -e 's/\btabular\b//g' *.lod
  4. ishnid

    Error: Column count won't match row???? Help needed

    It's also possible to load multiple rows of data in one statement. See the INSERT documentation.
  5. ishnid

    mysql prepare won't work outside of my loop

    What error are you getting?
  6. ishnid

    Executing file copy with quotes in file name not working

    The logic in your logging is incorrect. File::Copy's 'copy' function returns 0 on failure, not success. Have a look at the contents of $! - that should hold any error message. How do $filename and $szNewBBSfile get set?
  7. ishnid

    Make all variables "local"

    No problem. It would be unusual to declare all variables using 'local'. Any particular reason for it?
  8. ishnid

    Make all variables "local"

    All variables are package variables by default, unless stated otherwise. You'll have to declare them. You should know that 'local' in Perl means something different to what people often expect. You're more than likely looking for a lexical variable, which are declared using "my".
  9. ishnid

    adding a decimal point.

    Or: substr( $field3, length( $field3 ) - 2, 0, '.' );
  10. ishnid

    adding a decimal point.

    Divide by 100.
  11. ishnid

    Sorting an array of arrays, with Latex Output...

    Yes, either change the structure of @parts as it's being created, or else restructure it so it can be sorted easier. Here's an example (I've just used strings instead of the arrayrefs to illustrate): my @parts = (1,2602344000,'Ball Valve',1.0000,'array(memaddress)',2,2602345000,'Gate...
  12. ishnid

    Perl -M to check file modified time not working

    Also, try printing the outcome of using -M to see what values you are getting back. That'll give you a better indication of what comparisons you need to make.
  13. ishnid

    Perl -M to check file modified time not working

    I'd never rely on print statements to see if a file exists. Use -f or -e instead. I would expect that the files will only exist if $DirPath is the current working directory.
  14. ishnid

    Perl -M to check file modified time not working

    Firstly, make sure the file exists. Second, if you want it to be older than 60 minutes, you need -M to return a number greater than 0.0416, not less than it.
  15. ishnid

    Inline substitution

    How about: $a = 'HELO'; $c = 'BHEO'; if ( ( $a = "B$a" ) =~ y/L//d && $a eq $c ) { $c = 'YES'; }
  16. ishnid

    Inline substitution

    This does it: ( $a = "B$a" ) =~ y/L//d;
  17. ishnid

    Perl Reg exp: Parentheses in character class

    BTW, there's no need to escape parenthesis characters within a character class. This is fine: $line =~ /([()]+)/;
  18. ishnid

    Installing modules on shared hosting

    I'd check with my host if I were you: much easier if you can have shell access via SSH. See if this helps at all.
  19. ishnid

    Installing modules on shared hosting

    What OS is your shared server running? Do you have shell access?
  20. ishnid

    File::Find for non recursive searching

    Another alternative is to use File::Find::Rule, which allows you to set a maxdepth option. no_chdir isn't designed to do what you're looking for BTW.

Part and Inventory Search

Back
Top