Re: Query regarding Parallel::ForkManager

2012-03-30 Thread Dr.Ruud
On 2012-03-30 11:14, punit jain wrote: my $file = "/tmp/test"; die "\n Killed as filed doesnot exist \n" if(-e $file); It looks like you have to reverse your test. -e $file or die "[$$] exit early because '$file' doesn't exist\n"; But why even start a child, if its d

Re: Query on Qunatifiers

2010-07-15 Thread Jim Gibson
On 7/15/10 Thu Jul 15, 2010 12:24 PM, "Chandan Kumar" scribbled: > Hi guys, >   > I could able to understand the quantifiers. But still stuck with one > confusion.if dot operator is used with quantifiers. >   > ex: my string is $_="ths is my first regular expression"; >   > please explain t

Re: Query on Qunatifiers

2010-07-15 Thread Chandan Kumar
    Thanks in advance.     Best Regards, chandan. --- On Thu, 15/7/10, Chas. Owens wrote: From: Chas. Owens Subject: Re: Query on Qunatifiers To: "Thomas Bätzler" Cc: "Beginners Perl" , "Chandan Kumar" Date: Thursday, 15 July, 2010, 2:08 PM On Thu, Jul 15, 20

Re: Query on Qunatifiers

2010-07-15 Thread Chas. Owens
On Thu, Jul 15, 2010 at 03:22, Thomas Bätzler wrote: snip > In RE, a "." by itself is the atom that matches any one character. > > The quantifiers mean: > > "?" 0 or 1 occurences of the previous expression. > "+" 1 or more occurrences of the previous expression (greedy match). > "*" 0 or more occu

Re: Query on Qunatifiers

2010-07-15 Thread Shlomi Fish
On Thursday 15 Jul 2010 09:51:32 Chandan Kumar wrote: > Hi , > > I have query over quantifiers. > > Could you please explain the combination of operators Question mark > (?),dot(.),star(*),plus(+). > Say this is my string: > > $_ = " this is my first pattern ,quite confused with quantifi

Re: query

2009-12-22 Thread Parag Kalra
> > > my $input = shift; > what are we doing here? > First input paramter to the subroutine is getting shifted i.e getting stored in the variable '$input' > $sum += $_ for @digits; -> what exactly is the > . > All the elements of the array '@digits' are ge

Re: Query Online File Size

2009-11-26 Thread Giany
use LWP::UserAgent; sub GetFileSize{ my $url=shift; $ua = new LWP::UserAgent; $ua->agent("Mozilla/5.0"); my $req = new HTTP::Request 'HEAD' => $url; $req->header('Accept' => 'text/html'); $res = $ua->request($req); if ($res->is_success) {

RE: Query related to PAR::Packer

2009-06-23 Thread sanket vaidya
-Original Message- From: Anirban Adhikary [mailto:anirban.adhik...@gmail.com] Sent: Saturday, June 20, 2009 9:26 PM To: beginners@perl.org Subject: Query related to PAR::Packer >>Hi List >I need to run some applications written entirely in perl in some systems >where I dont have an acce

Re: query in searching

2009-03-24 Thread Chas. Owens
On Tue, Mar 24, 2009 at 19:50, Rajini Naidu wrote: snip >> open my $IN,  '<', "$data_dir/$node.load" or die "Cannot open >> '$data_dir/$node.load' $!"; >> open my $OUT, '>', "/tmp/$day[0].$day[1].$day[2].$node.log" or die "Cannot >> open '/tmp/$day[0].$day[1].$day[2].$node.log' $!"; >> >> while (

Re: query in searching

2009-03-24 Thread Rajini Naidu
Thanks John for the reply. I included the code as you suggested, but does'nt seem to work. The output file is empty. -rajini On Wed, Mar 25, 2009 at 12:19 AM, John W. Krahn wrote: > Rajini Naidu wrote: > >> Hi, >> > > Hello, > > > I am trying to search for a pattern in a file in my pe

Re: query in searching

2009-03-24 Thread John W. Krahn
Rajini Naidu wrote: Hi, Hello, I am trying to search for a pattern in a file in my perl script. Syntax used is : system("grep \"$res\" ${data_dir}/${node}.load > /tmp/${day[0]}.${day[1]}.${day[2]}.${node}.log"); But the grep command is'nt successful in getting the desired string. Am I miss

Re: Query in Perl Programming

2009-02-24 Thread Owen
On Tue, 24 Feb 2009 09:58:00 + "S, Rajini (STSD)" wrote: > > My code in the program is : That all seems to work. If you ever have problems getting a program to work, it is often advisable to add some debugging aids, and I have added a few to your code below so you might get the idea. uni

Re: Query in Perl Programming

2009-02-24 Thread Chas. Owens
shift; >    $dmy[1] = $month_num{lc $dmy[1]} || 0; > >    return timelocal(0, 0, 0, @dmy) / (24 * 60 * 60); >  } > } > > > -Rajini > > > > > >>-Original Message----- >>From: Rob Dixon [mailto:rob.di...@gmx.com] >>Sent: Tuesday, Feb

RE: Query in Perl Programming

2009-02-24 Thread S, Rajini (STSD)
- >From: Rob Dixon [mailto:rob.di...@gmx.com] >Sent: Tuesday, February 24, 2009 4:40 AM >To: Perl Beginners >Cc: S, Rajini (STSD) >Subject: Re: Query in Perl Programming > >S, Rajini (STSD) wrote: >> From: Owen [mailto:rc...@pcug.org.au] >>> S, Rajini (STSD) wrote: >&g

Re: Query in Perl Programming

2009-02-23 Thread Rob Dixon
S, Rajini (STSD) wrote: > From: Owen [mailto:rc...@pcug.org.au] >> S, Rajini (STSD) wrote: >>> >>> When I included the below code in my script, I am getting below >>> errors. >>> >>> Use of uninitialized value in integer ge (>=) at >>> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73. >>> Use

Re: Query in Perl Programming

2009-02-23 Thread Chas. Owens
On Mon, Feb 23, 2009 at 06:01, S, Rajini (STSD) wrote: snip > Still I get the message : syntax OK snip Odd, I am getting: Global symbol "$days1" requires explicit package name at z.pl line 5. Global symbol "$days2" requires explicit package name at z.pl line 6. Global symbol "$day" requires expl

RE: Query in Perl Programming

2009-02-23 Thread S, Rajini (STSD)
>> >> Yeah, the script posted below is part of the code In my script. >> >> After including the below code, when I ran the script, I am getting >> the "uninitialized value" errors. > > > >Nope > > >Do the following > > >Copy the code you posted to a new file > >add #!/usr/bin/perl to the first l

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > Yeah, the script posted below is part of the code > In my script. > > After including the below code, when I ran the script, > I am getting the "uninitialized value" errors. Nope Do the following Copy the code you posted to a new file add #!/usr/bin/perl to the first line then run perl

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
y 23, 2009 12:03 PM >To: S, Rajini (STSD) >Cc: Perl Beginners >Subject: RE: Query in Perl Programming > >> >> #perl -c

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > #perl -c

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
#perl -c

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > Hi Owen, > > My code is as follows : > > use strict; > use warnings; > use Time::Local; > > $days1 = epoch_days('30-Jan-09'); > $days2 = epoch_days('16-Feb-09'); > > $day = $days1 - $days2; > > print "Difference: @{[$days1 - $days2]} days\n"; > > BEGIN { > > my %month_num = do { > my $n =

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
en [mailto:rc...@pcug.org.au] >Sent: Monday, February 23, 2009 10:08 AM >To: S, Rajini (STSD) >Cc: Rob Dixon; Perl Beginners >Subject: RE: Query in Perl Programming > >> >> Hi Rob, >> >> When I included the below code in my script, I am getting below >&

RE: Query in Perl Programming

2009-02-22 Thread Owen
> > Hi Rob, > > When I included the below code in my script, I > am getting below errors. > > Use of uninitialized value in integer ge (>=) at > /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73. > Use of uninitialized value in integer lt (<) at > /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73.

RE: Query in Perl Programming

2009-02-22 Thread S, Rajini (STSD)
gt;From: Rob Dixon [mailto:rob.di...@gmx.com] >Sent: Friday, January 30, 2009 5:32 PM >To: Perl Beginners >Cc: S, Rajini (STSD) >Subject: Re: Query in Perl Programming > >S, Rajini (STSD) wrote: >> >> Hi Rob, >> >> When I set the date to 30-Jan-2009 and run the

Re: Query in Perl Programming

2009-01-30 Thread Rob Dixon
S, Rajini (STSD) wrote: > > Hi Rob, > > When I set the date to 30-Jan-2009 and run the code given below, > > Eg : > > When dates are set as : > > my $days1 = epoch_days('30-Jan-09'); > my $days2 = epoch_days('29-Feb-2009'); > > I get the below error. > > hpcll402:/home/raji/perl>./

RE: Query in Perl Programming

2009-01-30 Thread S, Rajini (STSD)
2009 4:43 PM >To: S, Rajini (STSD) >Cc: Perl Beginners >Subject: RE: Query in Perl Programming > >> >> Get the same error, when the date is set to >> >> my $days1 = epoch_days('30-Jan-09'); >> my $days2 = epoch_days('14-Feb-2009'); >

RE: Query in Perl Programming

2009-01-30 Thread Owen
-Original Message- >>From: Owen [mailto:rc...@pcug.org.au] >>Sent: Friday, January 30, 2009 4:09 PM >>To: S, Rajini (STSD) >>Cc: Perl Beginners >>Subject: RE: Query in Perl Programming >> >>> >>> Hi Rob, >>> >>> When I set the

RE: Query in Perl Programming

2009-01-30 Thread S, Rajini (STSD)
;Sent: Friday, January 30, 2009 4:09 PM >To: S, Rajini (STSD) >Cc: Perl Beginners >Subject: RE: Query in Perl Programming > >> >> Hi Rob, >> >> When I set the date to 30-Jan-2009 and run the code given below, >> >> Eg : >> >> When d

RE: Query in Perl Programming

2009-01-30 Thread Owen
> > Hi Rob, > > When I set the date to 30-Jan-2009 and run the code given below, > > Eg : > > When dates are set as : > > my $days1 = epoch_days('30-Jan-09'); > my $days2 = epoch_days('29-Feb-2009'); > > I get the below error. > > hpcll402:/home/raji/perl>./date2.pl > Day '30' out of range 1..2

RE: Query in Perl Programming

2009-01-30 Thread S, Rajini (STSD)
out of range 1..28 at ./date2.pl line 35 -Rajini >-Original Message- >From: S, Rajini (STSD) >Sent: Friday, January 30, 2009 9:50 AM >To: Rob Dixon; Perl Beginners >Subject: RE: Query in Perl Programming > > >Thanks Rob, the solution which you suggeste

RE: Query in Perl Programming

2009-01-29 Thread S, Rajini (STSD)
Thanks Rob, the solution which you suggested works fine. -Rajini >-Original Message- >From: Rob Dixon [mailto:rob.di...@gmx.com] >Sent: Wednesday, January 28, 2009 5:45 PM >To: Perl Beginners >Cc: S, Rajini (STSD) >Subject: Re: Query in Perl Programming > &g

Re: Query in Perl Programming

2009-01-28 Thread Gunnar Hjalmarsson
Rob Dixon wrote: S, Rajini (STSD) wrote: From: Gunnar Hjalmarsson [mailto:nore...@gunnar.cc] Your particular problem can be easily solved using only a module that is included in the standard Perl distribution. use Date::Parse; my $time1 = str2time '26-Jan-2009'; my $time2 = str2

Re: Query in Perl Programming

2009-01-28 Thread Rob Dixon
S, Rajini (STSD) wrote: > From: Gunnar Hjalmarsson [mailto:nore...@gunnar.cc] >> S, Rajini (STSD) wrote: >>> >>> I am new to Perl Programming and have a query in perl. >>> >>> In perl is there any system defined functions to find out the >>> Differences in dates. >>> >>> Eg : >>> >>> Date 1 ->

RE: Query in Perl Programming

2009-01-28 Thread S, Rajini (STSD)
42 PM >To: beginners@perl.org >Subject: Re: Query in Perl Programming > >S, Rajini (STSD) wrote: >> Hi, >> >> I am new to Perl Programming and have a query in perl. >> >> In perl is there any system defined functions to find out the >> Differences in

Re: Query in Perl Programming

2009-01-27 Thread Gunnar Hjalmarsson
S, Rajini (STSD) wrote: Hi, I am new to Perl Programming and have a query in perl. In perl is there any system defined functions to find out the Differences in dates. Eg : Date 1 -> 26-Jan-2009 Date 2 -> 14-Jan-2009 So the difference between two dates is 12 days. Is there a way to ac

Re: Query in Perl Programming

2009-01-27 Thread rhosto
On Jan 26, 9:37 pm, rajin...@hp.com (Rajini S) wrote: > Hi, > > I am new to Perl Programming and have a query in perl. > > In perl is there any system defined functions to find out the > Differences in dates. > > Eg : > > Date 1 -> 26-Jan-2009 > Date 2 -> 14-Jan-2009 > > So the difference between t

Re: Query in Perl Programming

2009-01-26 Thread Erez Schatz
2009/1/27 S, Rajini (STSD) : > > In perl is there any system defined functions to find out the > Differences in dates. > Not as such. There are ways to do it by using Date:: modules, like Date::Manip, Date::Calc, or DateTime. Try the following links for more detailed information about the how. h

RE: Query : Exectuting flow in parllel dirs

2009-01-20 Thread vivekananda.mohana
Any inputs? Lemme know if the Q is ambiguous? Thanks. Regards, Vivek From: Vivekananda Mohana (WT01 - PES-Semi-Technology) Sent: Sunday, January 18, 2009 8:36 PM To: beginners@perl.org Subject: RE: Query : Exectuting flow in parllel dirs Hi, Pls help with

RE: Query : Exectuting flow in parllel dirs

2009-01-18 Thread vivekananda.mohana
Hi, Pls help with the correct syntax. Appreciate the help. Thanks Regards, Vivek From: Vivekananda Mohana (WT01 - PES-Semi-Technology) Sent: Friday, January 16, 2009 3:23 PM To: 'beginners@perl.org' Subject: Query : Exectuting flow in parllel dirs Hi, I ha

Re: QUERY: batch CPAN installation...

2008-03-14 Thread Peter Scott
[top first posting reordered] On Fri, 14 Mar 2008 12:27:17 +0100, eMko wrote: > Andrew Wan wrote: >> I've got a list of CPAN modules that I want to install, over the >> internet. >> >> From experience, I just type cpan, then: install HTML::Clean >> (press RETURN for dependency prompts) install H

Re: QUERY: batch CPAN installation...

2008-03-14 Thread eMko
Hello. This command perl -MCPAN -e"install Wx, Tie::File, Tie::Hash" works well. It is only for instance, because Wx I have installed (and using) and either Tie::File or Tie::Hash comes with Perl. When running perl, the -M parameter tells it to use a package. -e parameter tells it to run som

Re: Query

2007-07-22 Thread yaron
OTECTED]> To: beginners@perl.org, "Paul Lalli" <[EMAIL PROTECTED]> Cc: beginners@perl.org Sent: 10:55:01 (GMT+0200) Africa/Harare יום שישי 20 יולי 2007 Subject: Re: Query Paul Lalli wrote: > On Jul 18, 6:43 am, [EMAIL PROTECTED] (kapil.V) wrote: >> su-2.05b# df

Re: Query

2007-07-21 Thread kapil.V
Paul Lalli wrote: On Jul 18, 6:43 am, [EMAIL PROTECTED] (kapil.V) wrote: su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9]+(\.

Re: Query

2007-07-19 Thread kapil.V
John W. Krahn wrote: kapil.V wrote: Hi, Hello, su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)?)[ M|G]/sg;

Re: Query

2007-07-19 Thread Paul Lalli
On Jul 18, 6:43 am, [EMAIL PROTECTED] (kapil.V) wrote: > su-2.05b# df -h . > Filesystem Size Used Avail Capacity Mounted on > /dev/ad0s1e 136G 102G 23G 82% /home > > From my script I do: > my $du = qx#df -h \.#; > ($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)

Re: Query

2007-07-18 Thread John W. Krahn
kapil.V wrote: Hi, Hello, su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)?)[ M|G]/sg; ^ ^

Re: Query

2007-07-18 Thread Mr. Shawn H. Corey
kapil.V wrote: Hi, su-2.05b# df -h . Filesystem Size Used Avail Capacity Mounted on /dev/ad0s1e 136G 102G 23G 82% /home From my script I do: my $du = qx#df -h \.#; ($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)?)[ M|G]/sg; ^^ looks fo

Re: Query

2007-07-18 Thread Jeff Pang
--- "kapil.V" <[EMAIL PROTECTED]> wrote: > Hi, > su-2.05b# df -h . > Filesystem Size Used Avail Capacity Mounted on > /dev/ad0s1e 136G 102G 23G 82% /home > > From my script I do: >my $du = qx#df -h \.#; >($total,$used) = $du =~ /([0-9]+(\.[ 0-9]+)?)[ > M|G]/sg

Re: query about code

2007-07-04 Thread Jenda Krynicky
From: "Amichai Teumim" <[EMAIL PROTECTED]> > Can someone explain to me what this script really does? I mean I see that it > lists dir within dir. But what is the code doing? For example all the blue > highlighted stuff, what is it doing? There is no highlighting in a plain text email! > #!/usr/

Re: query about code

2007-07-04 Thread Martin Barth
Hi, it was hard to see the blue stuff.. :) On Wed, 4 Jul 2007 16:14:47 +0300 "Amichai Teumim" <[EMAIL PROTECTED]> wrote: > #!/usr/bin/perl > > $startdir = "/lib"; > > $level = 0; > > list_dirs($startdir,$level); calls &list_dir with $startdir and $level. > > sub list_dirs(){ > my $dir

Re: Query an IP from file

2007-05-23 Thread Mumia W.
On 05/23/2007 03:01 AM, Jeff Pang wrote: Hello Thomas, I tried your codes,it's good I think. I've modified some of the codes to fit my situation. But if the network data files include too much IPs,my program used up all memory and couldn't get continued. Below are my modified codes.Attachmen

Re: Query an IP from file

2007-05-23 Thread Dr.Ruud
Jeff Pang schreef: > I have a text file which contains lots of IPs,like: > 58.253.0.0/16; > : > 60.3.0.0/16; Is it always /16? Can they overlap? > My question is,[ ]given an IP,[ ]ie 59.32.232.33,[ ]how > can I know it exists in this file or not? exists? ITYM: matches (they are masks) You cou

Re: Query an IP from file

2007-05-23 Thread Jeff Pang
Thomas Bätzler 写道: Hi, Jeff Pang <[EMAIL PROTECTED]> asked: I have a text file which contains lots of IPs,like: 58.253.0.0/16; 58.254.0.0/16; 58.255.0.0/16; 60.0.0.0/16; 60.1.0.0/16; 60.10.0.0/16; 60.16.0.0/16; 60.17.0.0/16; 60.18.0.0/16; 60.19.0.0/16; 60.2.0.0/16; 60.20.0.0/16; 60.21.0.0/16

Re: Query an IP from file

2007-05-22 Thread yaron
Hi Jeff, Can you be more specific regarding the query duty cycle. Do you want to read the file once and query it many times? Can the file change during queries? How much entries can be in such a file? Any solution that you will decide to use will be influence from such questions. with regards,

Re: Query an IP from file

2007-05-22 Thread John W. Krahn
Jeff Pang wrote: > Hello, Hello, > I have a text file which contains lots of IPs,like: > > 58.253.0.0/16; > 58.254.0.0/16; > 58.255.0.0/16; > 60.0.0.0/16; > 60.1.0.0/16; > 60.10.0.0/16; > 60.16.0.0/16; > 60.17.0.0/16; > 60.18.0.0/16; > 60.19.0.0/16; > 60.2.0.0/16; > 60.20.0.0/16; > 60.21.0.0/16

RE: Query an IP from file

2007-05-22 Thread Thomas Bätzler
Hi, Jeff Pang <[EMAIL PROTECTED]> asked: > I have a text file which contains lots of IPs,like: > > 58.253.0.0/16; > 58.254.0.0/16; > 58.255.0.0/16; > 60.0.0.0/16; > 60.1.0.0/16; > 60.10.0.0/16; > 60.16.0.0/16; > 60.17.0.0/16; > 60.18.0.0/16; > 60.19.0.0/16; > 60.2.0.0/16; > 60.20.0.0/16; > 60.2

Re: Query in pack and unpack functions

2007-05-03 Thread John W. Krahn
Dharshana Eswaran wrote: > Hi All, Hello, > My aim is to supply a hexadecimal value and print its binary value. > > I have written a small piece of code for the same: > > $input = 23; #any decimal value > $hex1 = sprintf ("%x",$input); > $binary = unpack 'B*', pack 'H*', $hex1; > @fields1 =

Re: Query in pack and unpack functions

2007-05-03 Thread Dharshana Eswaran
Thank you Dr.Ruud. It solved my problem. :-) Thanks and Regards, Dharshana On 5/3/07, Dr.Ruud <[EMAIL PROTECTED]> wrote: "Dharshana Eswaran" schreef: > $input = 23; #any decimal value > $hex1 = sprintf ("%x",$input); > $binary = unpack 'B*', pack 'H*', $hex1; > @fields1 = unpack 'A4A4', $

Re: Query in pack and unpack functions

2007-05-03 Thread Dr.Ruud
"Dharshana Eswaran" schreef: > $input = 23; #any decimal value > $hex1 = sprintf ("%x",$input); > $binary = unpack 'B*', pack 'H*', $hex1; > @fields1 = unpack 'A4A4', $binary; > print "$fields1[1] $fields1[0]";# i need to print the Lower > Nibble first and then the Higher nibble > > But

Re: Query regarding seek and tell

2007-03-12 Thread Beginner
On 12 Mar 2007 at 10:49, Tom Phoenix wrote: > On 3/12/07, Beginner <[EMAIL PROTECTED]> wrote: > > > What I am tring to do is find the x and y dimension of a jpeg > > Ah, Image::Size. > > http://search.cpan.org/~rjray/Image-Size-3.01/lib/Image/Size.pm > > Enjoy! Image::size & Image::Info a

Re: Query regarding seek and tell

2007-03-12 Thread Tom Phoenix
On 3/12/07, Beginner <[EMAIL PROTECTED]> wrote: What I am tring to do is find the x and y dimension of a jpeg Ah, Image::Size. http://search.cpan.org/~rjray/Image-Size-3.01/lib/Image/Size.pm Enjoy! --Tom Phoenix Stonehenge Perl Training -- To unsubscribe, e-mail: [EMAIL PROTECTED] For a

Re: Query regarding seek and tell

2007-03-12 Thread Rob Dixon
Beginner wrote: Hi, When I ask for the filehandle position (tell) it is reporting the pointer as being a few bytes further along than I expect it to be. For instance if I do this: #!/bin/perl use strict; use warnings; my ($start,$d,$var); my $file = 'myjpeg.jpg'; open(FH,$file) or die "Can't

Re: Query regarding seek and tell

2007-03-12 Thread Beginner
On 12 Mar 2007 at 9:34, Tom Phoenix wrote: > On 3/12/07, Beginner <[EMAIL PROTECTED]> wrote: > > > When I ask for the filehandle position (tell) it is reporting the > > pointer as being a few bytes further along than I expect it to be. > > > binmode(FH); > > > > while () { > > If it's a binary

Re: Query regarding seek and tell

2007-03-12 Thread Tom Phoenix
On 3/12/07, Beginner <[EMAIL PROTECTED]> wrote: When I ask for the filehandle position (tell) it is reporting the pointer as being a few bytes further along than I expect it to be. binmode(FH); while () { If it's a binary file, you shouldn't read it by "lines", which is what this does. You

Re: Query on pattern matching

2007-03-09 Thread Rob Dixon
Dharshana Eswaran wrote: On 3/9/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Chas Owens wrote: [snip] ( \w+ | \d+ | 0x[a-fA-F0-9] That only matches a single hexadecimal digit, you probably want 0x[a-fA-F0-9

Re: Query on pattern matching

2007-03-08 Thread Dharshana Eswaran
On 3/9/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Chas Owens wrote: > On 3/8/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: >> >> I need to extract few strings from one file and paste it to another file. > snip > > This doesn't seem like a good job for split. The split function is > good fo

Re: Query on pattern matching

2007-03-08 Thread John W. Krahn
Chas Owens wrote: > On 3/8/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: >> >> I need to extract few strings from one file and paste it to another file. > snip > > This doesn't seem like a good job for split. The split function is > good for parsing X separated records where X is either consta

Re: Query on pattern matching

2007-03-08 Thread Rob Dixon
Dharshana Eswaran wrote: Hi all, I need to extract few strings from one file and paste it to another file. My source file, i.e., my .h file, contains statements like: #define GMMREG_ATTACH_REQ_ID (GMMREG_PRIM_ID_BASE) /* @LOG GMMREG_ATTACH_REQ */ #define GMMREG_DETACH

Re: Query on pattern matching

2007-03-08 Thread Chas Owens
On 3/8/07, Dharshana Eswaran <[EMAIL PROTECTED]> wrote: Hi all, I need to extract few strings from one file and paste it to another file. snip This doesn't seem like a good job for split. The split function is good for parsing X separated records where X is either constant or simple. What yo

Re: [query] Using a scalar variable with match operator

2007-01-03 Thread John W. Krahn
Deepak Barua wrote: > > On 1/3/07, John W. Krahn <[EMAIL PROTECTED]> wrote: >> Deepak Barua wrote: >> >> >I want to use a scalar variable with OR "|" operator embedded in >> > the variable in a statement like >> > $start_pattern = "\/\* \| \/\/"; >> > >> > if(m/$start_pattern/ || $continue

Re: [query] Using a scalar variable with match operator

2007-01-03 Thread Deepak Barua
Hi John, I don't understand the script seems very cryptic, could you explain my $start_pattern = qr!/\*|//!; Regards Deepak On 1/3/07, John W. Krahn <[EMAIL PROTECTED]> wrote: Deepak Barua wrote: > Hi, Hello, >I want to use a scalar variable with OR "|" operator embedded in >

Re: [query] Using a scalar variable with match operator

2007-01-03 Thread John W. Krahn
Deepak Barua wrote: > Hi, Hello, >I want to use a scalar variable with OR "|" operator embedded in > the variable in a statement like > $start_pattern = "\/\* \| \/\/"; > > if(m/$start_pattern/ || $continue == 1) { > $chosen_pattern = $&; > Please inform me on how it is suppose

Re: Query

2006-05-19 Thread Dr.Ruud
"Kaushal Shriyan" schreef: > #!/usr/bin/perl -w > > whats -w flag stands for and what is its use, I mean How do i use it > and any other flags are also there, Please specify The Subject of your message doesn't cover your question, that is about the switches of the perl executable. >From the prom

Re: Query

2006-05-19 Thread Mr. Shawn H. Corey
On Fri, 2006-19-05 at 17:48 +0530, Kaushal Shriyan wrote: > Hi All > > #!/usr/bin/perl -w > > whats -w flag stands for and what is its use, I mean How do i use it > and any other flags are also there, Please specify The flags can be found in `perldoc perlrun`. -- __END__ Just my 0.0002 mi

RE: Query

2006-05-19 Thread Nagasamudram, Prasanna Kumar
Hi Kaushal -w is to enable warning messages. Try running the following code to see the difference with and w/o -w. x.pl - $str=a+2; print $str,"\n"; - $ perl x.pl 2 $ perl -w x.pl Unquoted string "a" may clash with future reserved word at p2.pl l

Re: Query on databases

2005-11-18 Thread Gayatri
Yup tht was the prob Thanks for pointing it out :-) - Original Message - From: "Michael Glaesemann" <[EMAIL PROTECTED]> To: "Gayatri" <[EMAIL PROTECTED]> Cc: "S, karthik (IE03x)" <[EMAIL PROTECTED]>; Sent: Friday, November 18, 2005 3

Re: Query on databases

2005-11-18 Thread Michael Glaesemann
On Nov 18, 2005, at 18:56 , Gayatri wrote: $host = "nnn.nn.nnn.nn"; ## 'n' is a number, host is ip address. $databaseName = "MyDatabase"; $dbh = DBI->connect('DBI:mysql:database=$databaseName;host=$host', $userName, $password, {RaiseError => 1}) || die "Can not connect to database $DBI::errs

Re: Query on databases

2005-11-18 Thread Gayatri
D-mysql, Perl 5.8.6 and windows. Regards, Gayatri. - Original Message - From: "S, karthik (IE03x)" <[EMAIL PROTECTED]> To: "Gayatri" <[EMAIL PROTECTED]>; Cc: "Alfred Vahau" <[EMAIL PROTECTED]> Sent: Friday, November 18, 2005 10:57 AM Subje

Re: Query on databases

2005-11-17 Thread Gayatri
Hi, Thanks a lot for yr kind help :-) It worked finally :-) Regards, Gayatri. - Original Message - From: "Pant, Hridyesh" <[EMAIL PROTECTED]> To: "'Gayatri'" <[EMAIL PROTECTED]>; Sent: Friday, November 18, 2005 12:27 PM Subject: RE: Query on

RE: Query on databases

2005-11-17 Thread Pant, Hridyesh
: Query on databases - Original Message - From: "Gayatri" <[EMAIL PROTECTED]> To: "S, karthik (IE03x)" <[EMAIL PROTECTED]> Sent: Friday, November 18, 2005 11:29 AM Subject: Re: Query on databases > Hi Karthik, > I downloaded DBD-Mysql frm the give

RE: Query on databases

2005-11-17 Thread S, karthik \(IE03x\)
opy of any e-mail and any printout thereof. -Original Message- From: Gayatri [mailto:[EMAIL PROTECTED] Sent: Friday, November 18, 2005 10:36 AM To: beginners@perl.org Cc: Alfred Vahau Subject: Re: Query on databases Thanks, I tried installing module using PPM. but its throwing following

Re: Query on databases

2005-11-17 Thread Gayatri
500 Can't connect to ppm.ActiveState.com:80 (connect: Unknown error) Im connceted to the internet, then wht could be the problem and solution? Regards, Gayatri. - Original Message - From: "Alfred Vahau" <[EMAIL PROTECTED]> To: Sent: Friday, November 18, 2005 5:19 AM

Re: Query on databases

2005-11-17 Thread Alfred Vahau
amp;s=31 modules. But the installation guide doesnt work as spcified. Wht do i do? Im using Windows platform and Perl 5.8.6 Regards, Gayatri - Original Message - From: "Michael David" <[EMAIL PROTECTED]> To: "Gayatri" <[EMAIL PROTECTED]>; Sent: Wednesday,

Re: Query on databases

2005-11-16 Thread Gayatri
l 5.8.6 Regards, Gayatri - Original Message - From: "Michael David" <[EMAIL PROTECTED]> To: "Gayatri" <[EMAIL PROTECTED]>; Sent: Wednesday, November 16, 2005 9:58 AM Subject: Re: Query on databases > > >- Original Message - > >From: &qu

Re: Query on databases

2005-11-15 Thread Michael David
- Original Message - From: "Gayatri" <[EMAIL PROTECTED]> To: Sent: Wednesday, November 16, 2005 2:39 PM Subject: Query on databases Hi all, Im a beginner in databases. Can you please let me know which DBD and DBI is required if I m using MySQL database. I tried using use DB_Fil

RE: query about hash

2005-07-15 Thread arjun.mallik
( Cluster "26" , Version "3.1" ) ( Cluster "991041" , Version "4.0" ) ) - thanks Arjun Deserve before you desire -Original Message- From: Jeff 'japhy' Pinyan [mailto:[EMAIL PROTECTED] Sent: Friday, July 15, 2005 9:22 PM To:

Re: query about hash

2005-07-15 Thread Jeff 'japhy' Pinyan
On Jul 15, [EMAIL PROTECTED] said: foreach $cluster ( @{$schedules->{$DAY->[friday]}->{STRUCT}} ) from $cluster i have to extract cluster number and version. How can i do that ?? Output is like below. - extract is HASH(0x4033d910) << From this 2 values are to be retrived . upl

RE: Query about "ssh" from perl program

2005-07-08 Thread Dhanashri Bhate
Hello John, Thank you very much! I made changes as per your inputs and it worked, Thanks again, Dhanashri -> -Original Message- -> From: Moon, John [mailto:[EMAIL PROTECTED] -> Sent: Friday, July 08, 2005 4:21 PM -> To: Dhanashri Bhate; beginners@perl.org -> Subject:

RE: Query about "ssh" from perl program

2005-07-08 Thread Moon, John
Subject: Query about "ssh" from perl program Hello All, I have a query about using "ssh" programmatically. I tried using both system and exec, but didn't work. I mean, I wanted some processing to happen on the remote machine to which i connect with "ssh", which is not happening. I have copied

RE: query

2005-07-07 Thread Thomas Bätzler
madhurima das <[EMAIL PROTECTED]> wrote: > I have the following problem: Looks like the previous time you posted this. [...] > my @z = system("assign.f",'$x','$y'); [...] Read the perlfunc manpage on system. 1. system does return a scalar. 2. that scalar is not the output of the program you c

Re: query

2005-07-07 Thread Chris Devers
On Thu, 7 Jul 2005, madhurima das wrote: > I have the following problem: Yes. We saw it each of the previous times you posted it. While you were posting this message twice and another one three times -- please don't ever do that again, by the way, thanks -- you got back several useful respons

Re: Query on File::Find

2005-07-07 Thread Shobha Deepthi
Hi Jeff, Thanks for your help. That really worked! Shobha Deepthi V The statement below is true. The statement above is false. Jeff 'japhy' Pinyan wrote: On Jul 7, Shobha Deepthi said: But I want to pass another parameter to find_and_instantiate_commav_file subroutine. I tried, fin

Re: Query on File::Find

2005-07-07 Thread Jeff 'japhy' Pinyan
On Jul 7, Shobha Deepthi said: But I want to pass another parameter to find_and_instantiate_commav_file subroutine. I tried, find({wanted => \&find_and_instantiate_commav_file("some_value"), no_chdir => 0}, $spec_entry); The syntax \&function returns a r

Re: Query on File::Find

2005-07-07 Thread John Doe
Shobha Deepthi am Donnerstag, 7. Juli 2005 06.19: > Hi, Hi probably not the best answer, but nobody else answered: > Am using find method in File::Find module. > Right now this method is being used as follows: >find({wanted => \&find_and_instantiate_commav_file, > no_

Re: Query on Split

2004-06-12 Thread Randy W. Sims
On 6/12/2004 8:33 AM, Rob Dixon wrote: John W. Krahn wrote: Sudhindra K S wrote: Hi Hello, I have a file with lines as shown below //abc/... - //xyz/... //abc1/... - //xyz1/... Now i want to split the lines at "-" and get the string on the left in one array and the string on the right in another a

Re: Query on Split

2004-06-12 Thread Rob Dixon
John W. Krahn wrote: > > Sudhindra K S wrote: > > > > Hi > > Hello, > > > I have a file with lines as shown below > > > > //abc/... - //xyz/... > > //abc1/... - //xyz1/... > > > > Now i want to split the lines at "-" and get the string on the left in one > > array and the string on the right in ano

Re: Query on Split

2004-06-11 Thread John W. Krahn
Sudhindra K S wrote: > > Hi Hello, > I have a file with lines as shown below > > //abc/... - //xyz/... > //abc1/... - //xyz1/... > > Now i want to split the lines at "-" and get the string on the left in one > array and the string on the right in another array. > > ie: array1 = (//abc, //abc1

Re: Query on Split

2004-06-10 Thread Rob Dixon
> Sudhindra K S wrote: > > I have a file with lines as shown below > > //abc/... - //xyz/... > //abc1/... - //xyz1/... > > Now i want to split the lines at "-" and get the string on the left in one > array and the string on the right in another array. > > ie: array1 = (//abc, //abc1) and array2 = (

Re: Query on Split

2004-06-10 Thread Prasanna Kothari
have a look at Split function: http://www.perldoc.com/perl5.8.4/pod/func/split.html sudhindra k s wrote: Hi I have a file with lines as shown below //abc/... - //xyz/... //abc1/... - //xyz1/... Now i want to split the lines at "-" and get the string on the left in one array and the string on t

  1   2   >