Re: Perl Newbie Question

2004-05-18 Thread James Edward Gray II
On May 18, 2004, at 1:10 PM, Perl Mail User wrote: Hello All, I have a question, I am looking to read the name of the file that I am passing as an argument to the perl script through the while (<>) part of the script. You're looking for the $ARGV variable. It contains the filename you need. Hop

RE: Perl Newbie Question

2004-05-18 Thread Bob Showalter
Perl Mail User wrote: > Hello All, Hi. Providing a real name would be considered polite. Also, please choose a meaningful subject. > > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part > of > the script

Re: Perl Newbie Question

2004-05-18 Thread Paul Johnson
On Tue, May 18, 2004 at 01:10:27PM -0500, Perl Mail User wrote: > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl script through the while (<>) part of > the script. $ARGV perldoc perlvar -- Paul Johnson - [EMAIL PROTECTED] http://

RE : Perl Newbie Question

2004-05-18 Thread Jose Nyimi
> -Message d'origine- > De : Perl Mail User [mailto:[EMAIL PROTECTED] > Envoyé : mardi 18 mai 2004 20:10 > À : [EMAIL PROTECTED] > Objet : Perl Newbie Question > > Hello All, > > I have a question, I am looking to read the name of the file that I am > passing as an argument to the perl

Re: perl newbie question

2005-07-25 Thread Edward WIJAYA
On Mon, 25 Jul 2005 21:39:50 +0800, <[EMAIL PROTECTED]> wrote: Can someone suggest a perl command line snippet that will print the last n lines of a file. If you are under unix/linux just use "tail -n" command. However if you really want to go via Perl command line: $perl -e ' open FH, "

Re: perl newbie question

2005-07-25 Thread Keith Worthington
hi , I am a perl newbie. Can someone suggest a perl command line snippet that will print the last n lines of a file. thanks in advance. regards, Kaushik Kaushik, If you are on the command line I suggest the use of the tail command. tail -n 123 filename If you must perform this oper

RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Edward WIJAYA wrote: > On Mon, 25 Jul 2005 21:39:50 +0800, <[EMAIL PROTECTED]> wrote: > > >> Can someone suggest a perl command line snippet that will print the >> last n >> lines of a file. > > > If you are under unix/linux > just use "tail -n" command. > > However if you really want to go vi

Re: perl newbie question

2005-07-25 Thread Matthias Ochs
[EMAIL PROTECTED] wrote: hi , I am a perl newbie. Can someone suggest a perl command line snippet that will print the last n lines of a file. Why do you want a Perl line for that? You could just use 'tail' (assuming you run some kind of UNIX). Matthias -- To unsubscribe, e-mail: [E

Re: perl newbie question

2005-07-25 Thread Jeff 'japhy' Pinyan
On Jul 25, [EMAIL PROTECTED] said: Can someone suggest a perl command line snippet that will print the last n lines of a file. The File::ReadBackwards module does it for you rather simply. -- Jeff "japhy" Pinyan % How can we ever be the sold short or RPI Acacia Brother #734 % th

RE: perl newbie question

2005-07-25 Thread Larsen, Errin M HMMA/Information Technology Department
Dave Adams wrote: > Larsen, > Hi Dave. My name is Errin. Larsen is my surname. Please, when posting replies, post to the list. > I am afraid I cannot get your suggested code to work. Especially > line that reads "foreach reverse 0..$n;" > > On 7/25/05, Larsen, Errin M HMMA/Information

Re: perl newbie question

2005-07-25 Thread John W. Krahn
[EMAIL PROTECTED] wrote: > hi , Hello, > I am a perl newbie. > Can someone suggest a perl command line snippet that will print the last n > lines of a file. perl -ne'INIT{$#x=shift()[EMAIL PROTECTED](splice(@x,1),$_)[EMAIL PROTECTED]' 4 yourfile John -- To unsubscribe, e-mail: [EM

Re: perl newbie question

2005-07-25 Thread FreeFall
try: perl -ne '$line=$_;END{print $line}' yourfile On Mon, 25 Jul 2005 19:09:50 +0530 [EMAIL PROTECTED] wrote: > > hi , > I am a perl newbie. > Can someone suggest a perl command line snippet that will print the last n > lines of a file. > > thanks in advance. > regards, > Kaushik > >

Re: perl newbie question

2005-07-26 Thread Jay Savage
On 7/25/05, FreeFall <[EMAIL PROTECTED]> wrote: > try: > perl -ne '$line=$_;END{print $line}' yourfile > > On Mon, 25 Jul 2005 19:09:50 +0530 > [EMAIL PROTECTED] wrote: > > > > > hi , > > I am a perl newbie. > > Can someone suggest a perl command line snippet that will print the last n >

Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-15 Thread Telemachus
On Wed Jan 14 2009 @ 8:17, dolphin_sonar wrote: > Hi, > > I bought the O'Reilly 5th edition Learning Perl the other day and it's > great. I am new to programming and Perl as well. I do know my way > around Linux but I am having problems upgrading from the version that > was on my OS (Cent OS 5.2)

Re: Perl Newbie question about upgrade from Perl 5.8.8 to 5.10

2009-01-16 Thread dolphin_sonar
On Jan 15, 7:39 am, telemac...@arpinum.org (Telemachus) wrote: > On Wed Jan 14 2009 @  8:17, dolphin_sonar wrote: > > > > > Hi, > > > I bought the O'Reilly 5th edition Learning Perl the other day and it's > > great. I am new to programming and Perl as well. I do know my way > > around Linux but I a

RE: Perl Newbie question: How would you take keyboard input and run a shell scrip with that input?

2003-12-31 Thread Paul Kraus
I don't think you could be vaguer :) Very basic #!/usr/bin/perl # update.pl multiple options command line my @packages = @ARGV foreach (@packages){ system(packageexecutableforupdate); #with output captured My $output = `packageexecutableforupdate`; } Not tested of cou