Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://257517]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-19 21:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found