if($filename ne "." && $filename ne ".." && substr($filename,length($filename)-4,4) eq ".jpg")
1) Is there such a thing as a file which ends ".jpg" and also equals "."? No, so you don't need those clauses, just the ".jpg" one. Nor do you need the length in order to do a negative substring. But as noted above, checking whether it matches /\.jpg$/i is a better test.
2) You're having trouble figuring out the URL? We can't help you because we don't know your server. It could be anything. If your server is "metlelite.com" and the images are in "public_html/foo/bar/images/" then the URL is probably "metlelite.com/foo/bar/images/filename.jpg". Trial and error should sort that out!
3)
would be a lot easier on the eye if you used the qq() function, as inprint FIL "<pic$t name=\"$nfile\"></pic$t>\n";
print FIL qq(<pic$t name="$nfile"></pic$t>\n)";
4) It would probably be better to use an XML module, in the long run. Your output is technically XML but all kinds of errors and incompatibilities could creep in and you'd never know because you're rolling it by hand.
($_='kkvvttuu bbooppuuiiffss qqffssmm iibbddllffss')
=~y~b-v~a-z~s; print
In reply to Re: creating an xml file from perl
by Cody Pendant
in thread creating an xml file from perl
by decerebrate
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |