'ls' question, splitting and files with spaces in their name...

Jim Rootham jim.rootham-H217xnMUJC0sA/PxXw9srA at public.gmane.org
Sun May 23 18:16:12 UTC 2004


>Hi Tim,
>
>   I am trying to test this command with a mini script I wrte based on
>your suggestion but for the life of me I can't get the darn thing to
>tun. Can you see if I made an error somewhere?
>
>=- Code
>#!/usr/bin/perl
>use CGI::Carp "fatalsToBrowser";
>print "Content-type: text/html\n\n";
>
>print "<pre>\n";
>opendir(DIR, /home) or die "Can't open root: $!";
>for (readdir(DIR))
>{
>	($dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime, $mtime,
>$ctime, $blksize, $blocks) = stat($_);
>	print "$dev, $ino, $mode, $nlink, $uid, $gid, $rdev, $size, $atime,
>$mtime, $ctime, $blksize, $blocks\n";
>}
>closedir(DIR)
>print "</pre>\n";
>=- End Code
>
>it keeps resulting in:
>
>=- Error
>Software error:
>
>syntax error at /pwp/cgi-bin/tle-bu/tmp/dirtest.cgi line 13, near "print
>"</pre"
>Can't find string terminator '"' anywhere before EOF at
>/pwp/cgi-bin/tle-bu/tmp/dirtest.cgi line 13.
>
>For help, please send mail to the webmaster (root-bi+AKbBUZKZeoWH0uzbU5w at public.gmane.org), giving
>this error message and the time and date of the error.
>=- End Error
>

Hmm, missing semicolon on closedir(DIR)  ?
--
The Toronto Linux Users Group.      Meetings: http://tlug.ss.org
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://tlug.ss.org/subscribe.shtml





More information about the Legacy mailing list