Hi, I'd like to ftp the newest file in a directory from a unix box to our windows network. To do this, I plan to use the following to find the newest file: ...
Instead of "" , Use back quotes `` that are near key button 1 . ... From: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com] On Behalf Of...
Jay, Thank you. That got me farther along, but I still have an issue. I've now got: $filename = `ls -at1 /head -1`; print "put $c\n"; What I get is: /head: No...
... ReginaM> Thank you. ReginaM> That got me farther along, but I still have an issue. ReginaM> I've now got: ReginaM> $filename = `ls -at1 /head -1`; If...
Hi, I'm trying to use perl on solaris to copy a file which may have spaces in it. I can't even get it to work without spaces. On the command line, this works:...
... Save yourself hassle, and make your script more secure and portable, by using File::Copy: use File::Copy; File::Copy::copy($filename, 'junk.txt) or die...
Can't speak for windows, but I think for linux the brackets are not required. ________________________________ From: Yatin Jadhav <yatinjdhv@...> To:...
27216
Christian Fuchs
agentphreak@...
Oct 31, 2011 4:22 pm
Hi everybody, I just wrote a little script for practising perl.It's a perl rewrite of the tac tool. It does what it should do, but it just doesn't end ;) I can...
27217
Shawn H Corey
shawnhcorey@...
Oct 31, 2011 4:27 pm
... You don't need the while loop. When you read a file handle into an array, the entire stream gets read. It reverses and print the contents. It then goes...
try this: Â use strict; use warnings; use strict; use warnings; my $lines = <>; $lines = reverse $lines; print $lines; ________________________________ From:...
27219
Shawn H Corey
shawnhcorey@...
Oct 31, 2011 5:30 pm
... Duplicate, not needed. ... Duplicate, not needed. ... This will read only one line, with a newline at the end. ... This will reverse the characters in the...
After a nice long weekend, I am back trying to cp a file in perl. I am on a Sun Solaris box. Thanks for all of your responses, but still no luck. I've tried 3...
Did you chomp? ... From: perl-beginner@yahoogroups.com [mailto:perl-beginner@yahoogroups.com] On Behalf Of rmillergraysharbor Sent: Monday, October 31, 2011...
... Amish> right, i just replaced the array with a scalar on ur script. And broke it. If your help hurts more than it helps, please stop answering. It makes ...
... rmillergraysharbor> my($filename) = `ls -at1 rmillergraysharbor> /sds/ibr/waibrs/submit/SPD/00*`; Why are you using "ls" when Perl is perfectly good at...
27225
Shawn H Corey
shawnhcorey@...
Oct 31, 2011 6:02 pm
... Actually, it's not clear if the OP wanted to reverse the order of the lines in the file or reverse each line but keep the same order. Or perhaps both. We...
Because I want the latest one, so I need them in order, not by name, but by datetime. ... From: Randal L. Schwartz [mailto:merlyn@...] Sent: Monday,...
... Then do so in Perl, in a robust and portable way: my @files_sorted = sort { -M $a <=> -M $b } glob "/sds/ibr/waibrs/submit/SPD/00*"; That will give you the...
... Yup, the newline from the `ls -at1` output was the reason behind the (fairly clear) error message you received when using File::Copy. Whilst you now have a...
27230
Christian Fuchs
agentphreak@...
Oct 31, 2011 8:02 pm
... Sorry that i hadn't made it clear enough. My purpose is to get the words in the same order as they are, but reversing the lines in which they are printed...
Hi Christian ... * *I believe Shawn script will do exactly what you are asking for, however, if you want a one liner without the array variable you could also...
Hi, I am learning perl and I need to create a regexp that extract only the 4 digits after the "-" Below the string: 20111014-18:00:14.474 : 8=FIX.4.2 9=68 35=1...