[svlug] [perl] question

Bill Schoolcraft bill at wiliweld.com
Sun Jan 27 13:58:01 PST 2002


At Sun, 27 Jan 2002 it looks like Lutz Birkhahn composed:

> Bill Schoolcraft wrote:
> > In using the special literal __FILE__ I'm trying to print the name
> > of the file in my cgi-scripts output, it does so "BUT" give me the
> > absolute path, I'm just looking for the filename. Can any tell me
> > what to change.?
> 
>   use File::Basename;
> 
>   print "The name of the perl script is ",basename(__FILE__),".\n";
> 
> $0 also contains the name of the script. Seems to me "more normal" than
> __FILE__, especially after reading "man perldata" about special literals:
> "they may be used only as separate tokens; they will not be interpolated
> into strings...".

I should explain, I'm taking my first formal Perl class here in San
Francisco and despite the beautiful weather today I'm working on my
first homework assignment.

I appreciate your help, there so much to Perl and so many different
ways to do things.....

-- 
Bill Schoolcraft            
PO Box 210076                 -o)
San Francisco CA 94121         /\
"UNIX, A Way Of Life."        _\_v
http://forwardslashunix.com






More information about the svlug mailing list