Re: A Strange Syntax

2005-12-05 Thread Jennifer Garner
${*{$::{sym}}{HASH}}{name}; As we know, $::{sym} == *main::sym, it's a typeglob. but what is **main::sym? and the same,what is *{$glob}?thanks. On 12/6/05, Flemming Greve Skovengaard <[EMAIL PROTECTED]> wrote: > > Wiggins d'Anconia wrote: > > > > Now that you understand it, replace it with $sym-

RE: Skip then print

2005-12-05 Thread David Sudjiman
On Mon, 5 Dec 2005, Moon, John wrote: > while ($line = <>) { > next if $. <= 10; > ... > } CMIIW, this one will check (if $.) for each of the line. thx .dave http://www.davidsudjiman.info -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED

Re: Skip then print

2005-12-05 Thread David Sudjiman
On Mon, 5 Dec 2005, Ron McKeever wrote: > Hello, > > I would like to skip the first ten lines of output from tail, then print any > new records matching my array, but I seem to be stuck, below will run but > nothing prints: > tail /var/log/messages is piped to it... > > #!/usr/bin/perl > > my

RE: Skip then print

2005-12-05 Thread Moon, John
From: Ron McKeever [mailto:[EMAIL PROTECTED] Sent: Monday, December 05, 2005 11:50 AM To: beginners@perl.org Subject: Skip then print Hello, I would like to skip the first ten lines of output from tail, then print any new records matching my array, but I seem to be stuck, below will run but noth

Hashes and Magic Numbers

2005-12-05 Thread Dylan Stamat
I've read in multiple places that the format of hashed/crypted/salted data should look something like so: $magic_number$ + salt + data It looks like the magic number portion is specific to the type of algorithm used... ie: MD5= $1$ Blowfish = $2$ Apache= $arp1$ Can someone point me

RE: Dates again.

2005-12-05 Thread Rafael Morales
I had found a solution: my $num_day = 72 * 60 * 60 *24; my $result = $today - $num_day; my $end = strftime "%Y-%m-%d", localtime($result); But Timothy, I see that your solution is better :), all in one line. Thanks to all you. - Original Message - From: "Timothy Johnson" <[EMAIL PROTECT

Re: A Strange Syntax

2005-12-05 Thread Flemming Greve Skovengaard
Wiggins d'Anconia wrote: Now that you understand it, replace it with $sym->{name} so the next person doesn't have to ask. Unless you are using a really old Perl. Actually that should be *sym->{name} instead of $sym->{name} ( or %sym->{name} but that's deprecated ). Else you get "Variable "$sy

Re: Re: Dates again.

2005-12-05 Thread Beau E. Cox
Hi vmalik - At 2005-12-05, 07:09:51 you wrote: >I am assuming that localtime() returns the time in unix file format (number of >seconds since 12:00 AM on January 01, 1970). Why don't you convert 72 days to >seconds and subtract that number from the output of localtime()? No. time() returns epo

RE: Dates again.

2005-12-05 Thread Timothy Johnson
localtime() returns an array with populated with the details about the current time and date (unless you feed it a date in Perl time() format). The key, then is to get your text date into Perl time format. Some modules that can help you are Date::Manip, Date::Calc, and Time::Local. I prefer the

Timeout value for a socket?

2005-12-05 Thread Scott
I currently have written a socket script that creates a socket connection to a remote socket. Passes some values, and the remote script then takes those values and passes them to a system() call. The local script then waits for the remote script to send a response back. Since the local script has

Re: A Strange Syntax

2005-12-05 Thread Wiggins d'Anconia
Adriano Ferreira wrote: > On 12/5/05, Jennifer Garner <[EMAIL PROTECTED]> wrote: > >>print ${*{$::{sym}}{HASH}}{name}; > > >>How to analyse the last sentence of that code?Thanks. > > >>From "perldoc perlref" > >7. A reference can be created by using a special syntax, lovingly >

Re: Skip then print

2005-12-05 Thread Shawn Corey
Ron McKeever wrote: I would like to skip the first ten lines of output from tail If you want the last line of a file, you can get tail to print only that. See `man tail`. $ tail -n 1 -- Just my 0.0002 million dollars worth, --- Shawn "Probability is now one. Any problems that are

Re: Dates again.

2005-12-05 Thread vmalik
I am assuming that localtime() returns the time in unix file format (number of seconds since 12:00 AM on January 01, 1970). Why don't you convert 72 days to seconds and subtract that number from the output of localtime()? For example, 72 days = 72 x 3600 x 24 seconds = 6220800 seconds So, try:

Dates again.

2005-12-05 Thread Rafael Morales
Hi to all !!! Now I have a new trouble with dates. How can I know the date of 72 days ago ?. For example for get 2005-12-05, I do this use POSIX qw(strftime); my $today = strftime "%Y-%m%d", localtime(); I would like to get this date: 2005-09-21. Thanks list. --

Skip then print

2005-12-05 Thread Ron McKeever
Hello, I would like to skip the first ten lines of output from tail, then print any new records matching my array, but I seem to be stuck, below will run but nothing prints: tail /var/log/messages is piped to it... #!/usr/bin/perl my @names = ("nb","tp","ape","berry","jab"); my $log = "/local/

Re: Help required about NET::TELNET

2005-12-05 Thread Stephen Kratzer
Mazhar, try: $telnet->waitfor(Match => '/login: $/i'); and $telnet->waitfor(Match => '/password: $/i'); Vishal, Right, you want to wait for the device to return something that will match the expression between the slashes. In that example, you'd be waiting for the device to return a login prom

Re: Help required about NET::TELNET

2005-12-05 Thread vmalik
Hey Mazhar, I don't know much about perl, but in the $telnet->waitfor method, what does the weird parameter mean ('/login: $/i')? I thought that $ means a scalar variable in perl. What do the forward slashes do here? Some sort of regular expression?? Vishal Quoting Mazhar <[EMAIL PROTECTED]>:

Re: A Strange Syntax

2005-12-05 Thread Adriano Ferreira
On 12/5/05, Jennifer Garner <[EMAIL PROTECTED]> wrote: > print ${*{$::{sym}}{HASH}}{name}; > How to analyse the last sentence of that code?Thanks. >From "perldoc perlref" 7. A reference can be created by using a special syntax, lovingly known as the *foo{THING} syntax. *foo{T

Re: Replace only once.

2005-12-05 Thread mohd sharif
But it will fail if we have spaces before $modtager = " 45247"; You should probably write like this. #!/usr/bin/perl $modtager = "45247"; $modtager =~ s/^\s+//g; # deletes all leading spaces in variable $modtager =~ s/^(45)//; # guarantees match of 45 -Sharif On 12/2/05, Alexandre Checin

A Strange Syntax

2005-12-05 Thread Jennifer Garner
Hi,lists, Seeing this code please: our %sym = ( name => 'flower', age => 23, ); print ${*{$::{sym}}{HASH}}{name}; The result of printing is : flower. How to analyse the last sentence of that code?Thanks.

Help required about NET::TELNET

2005-12-05 Thread Mazhar
Hi Folks, I have installed the module NET::TELNET from CPAN and when i try to execute the below simple pgm, --- use Net::Telnet; $telnet = new Net::Telnet ( Timeout=>100,Errmode=>'die'); $telnet->open('202.177.129.37'); $teln

Re: installing DBD::mysql

2005-12-05 Thread John Doe
Octavian Rasnita am Montag, 5. Dezember 2005 10.58: > From: "John Doe" <[EMAIL PROTECTED]> > > > You may have a too old version of mysql / DBD::mysql, but it's just a > > guess > > > since you didn't provide version information. > > I am using MySQL 5.0.16-standard and the latest DBD::mysql (3.000

Re: installing DBD::mysql

2005-12-05 Thread Octavian Rasnita
From: "John Doe" <[EMAIL PROTECTED]> > You may have a too old version of mysql / DBD::mysql, but it's just a guess > since you didn't provide version information. > I am using MySQL 5.0.16-standard and the latest DBD::mysql (3.0002). > Otherwise, you may have noticed the following sentence in t

Re: installing DBD::mysql

2005-12-05 Thread John Doe
Octavian Rasnita am Montag, 5. Dezember 2005 10.05: [...] > Oh yes MySQL was running when I have tried to install DBD::mysql. > I was able to connect to it using "mysql" command. > But it was using /tmp/mysql.sock socket defined in my.cnf. > > However, the "make test" command told that it cannot co

Re: installing DBD::mysql

2005-12-05 Thread Octavian Rasnita
From: "Mazhar" <[EMAIL PROTECTED]> I think the MYSQL service is not running on your system, Just execute the below commands service mysqld restart I think this might solve your problem Oh yes MySQL was running when I have tried to install DBD::mysql. I was able to connect to it using "mysql" c

Re: installing DBD::mysql

2005-12-05 Thread Mazhar
I think the MYSQL service is not running on your system, Just execute the below commands service mysqld restart I think this might solve your problem Regards Mazhar On 12/4/05, John Doe <[EMAIL PROTECTED]> wrote: > > Octavian Rasnita am Samstag, 3. Dezember 2005 19.50: > > Hi, > > > > I have tr