in reply to Re: Referencing string: Can't use string as a SCALAR ref
in thread Referencing string: Can't use string as a SCALAR ref

Thank you :) I have it working now. I'm just curious if I can do it a better way.

-P0w3rK!d

  • Comment on Re: Re: Referencing string: Can't use string as a SCALAR ref

Replies are listed 'Best First'.
Re: Re: Re: Referencing string: Can't use string as a SCALAR ref
by antirice (Priest) on May 12, 2003 at 19:23 UTC
    There is a better way to do it. (Which happens to be Limbic~Region's first suggestion.) As an added bonus, it also makes the code more portable to other OS's (as long as you have the script setup a directory or something rather than hard-coding it.)

    use File::Basename; my $file = basename($filestring); print $file,$/;

    antirice    
    The first rule of Perl club is - use Perl
    The
    ith rule of Perl club is - follow rule i - 1 for i > 1