Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

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

by P0w3rK!d (Pilgrim)
on May 12, 2003 at 18:33 UTC ( #257517=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://257517]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (6)
As of 2019-12-09 02:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?