Re: regex to get the rpm name version

2018-08-09 Thread Andy Bach
header tag to be printed, enclosed by {} characters. Tag names are case insensitive, and the leading RPMTAG_ portion of the tag name may be omitted as well. On Thu, Aug 9, 2018 at 4:32 PM, Home Linux Info wrote: > > Hello, > > You can begin with "*[a-zA-Z_+-]{3

Re: regex to get the rpm name version

2018-08-09 Thread Home Linux Info
Hello, You can begin with "*[a-zA-Z_+-]{3,}[0-9]*" to get the package name, it needs a little more work for right now it gets the last dash and first digit of package version. Then you can try "*([^a-zA-Z_+-]{3,})(.\d{1,})*". The first regex gives the following result: /b

Re: regex to get the rpm name version

2018-07-27 Thread Shlomi Fish
Hi Asad, On Fri, 27 Jul 2018 18:24:39 +0530 Asad wrote: > Hi All , > > I want to get a regex to actually get the rpm name and version for > comparison : > > > binutils-2.23.52.0.1-12.el7.x86_64", > compat-libcap1-1.10-3.el7.x86_64" > compat-lib

Re: regex to get the rpm name version

2018-07-27 Thread Chas. Owens
, $version, $build) = $s =~ m{ ^ (.*) # name - (.*) # version - ([0-9]+) # build [.] [^.]+ # os [.] [^.]+ \z # architecture }x; print "n $name v $version b $build\n"; } On Fri, Jul 27, 2018 at 9:14 AM Chas. Owens wrote: > I don't think a regex is the simplest and most maint

RE: regex to get the rpm name version

2018-07-27 Thread Duncan Ferguson
I would suggest you change your approach and user the query mode of RPM to get your information instead of build up a regexp: rpm -qa --queryformat "%{NAME}\n" Duncs From: Asad [mailto:asad.hasan2...@gmail.com] Sent: 27 July 2018 13:55 To: beginners@perl.org Subject: regex to g

Re: regex to get the rpm name version

2018-07-27 Thread Chas. Owens
I don't think a regex is the simplest and most maintainable way to get this information. I think it is probably better to take advantage of the structure of the string to discard and find information: #!/usr/bin/perl use strict; use warnings; for my $s (qw/binutils-2.23.52.0.1-12.el7.x

regex to get the rpm name version

2018-07-27 Thread Asad
Hi All , I want to get a regex to actually get the rpm name and version for comparison : binutils-2.23.52.0.1-12.el7.x86_64", compat-libcap1-1.10-3.el7.x86_64" compat-libstdc++-33-3.2.3-71.el7.i686 (^[a-zA-Z0-9\-]*)\-\d' First part of the regular expression is ^[a-zA

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-16 Thread Chris Fedde
e/aj/out.txt'); > my $data = $file->slurp_utf8; > $data =~ s/some label.*/${1} $newdata} ]/x; > $file->spew_utf8( $data ); > > The app runs as > > USER = "appuser" > GROUP = "appgroup" > > and the

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread Chas. Owens
snip > So I guess the question is - > > - is there a way in perl to authorize the callED perl script to have > higher perms than the callING app's, so that it can write to the file I'm > targeting? > > Or do I have to to this OUTSIDE of the perl script? > The short answer is that this is OS depen

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread alanj
me/aj/out.txt But if the calling app's running as a unique user 'appuser' == 'testapp' 'appgroup' == 'testapp' where id testapp uid=12345(testapp) gid=12345(testapp) groups=12345(testapp) grep testapp /etc/

Re: How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread Rob Dixon
$data =~ s/some label.*/${1} $newdata} ]/x; > $file->spew_utf8( $data ); > >The app runs as > > USER = "appuser" > GROUP = "appgroup" > >and the perl-script's output file gets CHANGED to ownership by the SAME >user & group

How to get a called perl script to write output to a file with DIFFERENT user:group than the calling app?

2017-01-15 Thread alanj
rl-script's output file gets CHANGED to ownership by the SAME user & group, 'appuser'/'appgroup'. How do I get that output file written with owndership by some OTHER user, eg USER = "otheruser" GROUP = "othergroup" ? AJ -- T

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-15 Thread Shlomi Fish
Hi Raj, On Thu, 14 Apr 2016 16:15:08 + Raj Barath wrote: > I was wrong. Please don't use my example. > Aaron wells explanation is perfect. > Thanks for admitting you were wrong - many people fail to do so. I agree that Aaron Wells's explanation appears to be very good, and one can find mor

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
either a string, a number, or a reference of some sort. Then if what you’ve gotten is a reference, and you want to get values out of it, you need to dereference that, as I’ve shown in the last example ( [SIGIL]{ $ref }, etc. ). $way1 above shows explicitly the chain of dereferencing that happens as

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
either a string, a number, or a reference of some sort. Then if what you’ve gotten is a reference, and you want to get values out of it, you need to dereference that, as I’ve shown in the last example ( [SIGIL]{ $ref }, etc. ). $way1 above shows explicitly the chain of dereferencing that happens as

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Aaron Wells
that whenever you retrieve a value from a data structure, it’s going to be a scalar: either a string, a number, or a reference of some sort. Then if what you’ve gotten is a reference, and you want to get values out of it, you need to dereference that, as I’ve shown in the last example ( [SIGIL]{

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Shlomi Fish
Hello Raj, On Thu, 14 Apr 2016 03:52:56 + Raj Barath wrote: > Hello Kenneth, > > Check this out: > > use v5.22; > use Data::Dumper; > > my $VAR1; > > $VAR1 = [ > bless( { >'Id' => [ >'01tC003udXAIAY', >

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
;>'Id' => [ >>'01tC003udXAIAY', >>'01tC003udXAIAY' >> ], >>'type' => 'Product2' >>

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-14 Thread Raj Barath
;>'Id' => [ >>'01tC003udXAIAY', >>'01tC003udXAIAY' >> ], >>'type' => 'Product2' >>

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
'type' => 'Product2' >> }, 'sObject' ) >> ]; >> >> So if the data structure is contained in a Perl variable called >> $data, then I think that this is a reference to a hash. >> >> So

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Lawrence Statton
$data, then I think that this is a reference to a hash. So I need to do something like "@{$data}" to get to the hash. But I want the "Id" element of the hash so I want something like @{$data}->{'Id'} But that's the array, so what about ${@{$data}->{&#x

Re: How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Ken Slater
; > So if the data structure is contained in a Perl variable called > $data, then I think that this is a reference to a hash. > > So I need to do something like "@{$data}" to get to the hash. > > But I want the "Id" element of the hash so I want something li

How to navigate through a hash of hashes of arrays (?) to get to the first array entry

2016-04-13 Thread Kenneth Wolcott
'01tC003udXAIAY' ], 'type' => 'Product2' }, 'sObject' ) ]; So if the data structure is contained in a Perl variable called $data, then I think that this is a reference to a hash. So I ne

Re: Eclipse - How do I get back to the first splash screen

2015-03-13 Thread Jim Gibson
> On Mar 13, 2015, at 2:07 PM, Sherman Willden > wrote: > > I downloaded Eclipse and I was looking at the screens and in general just > messing with Eclipse. Now I can't find the first splash screen with the > tutorials, samples, and such. Also is there a help button on Eclipse? It has been

Eclipse - How do I get back to the first splash screen

2015-03-13 Thread Sherman Willden
I downloaded Eclipse and I was looking at the screens and in general just messing with Eclipse. Now I can't find the first splash screen with the tutorials, samples, and such. Also is there a help button on Eclipse? Thank you; Sherman

[OT] get ready to party video?

2015-02-18 Thread Luca Ferrari
Ok, this is not a code related question, but anyone has an idea of when/how/if it will be available the video of the FOSDEM Larry's talk? https://fosdem.org/2015/schedule/event/get_ready_to_party/ I'm very curious about it! Luca -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For addi

Re: Get return value when running cmd like this

2015-01-05 Thread Charles DeRykus
On Mon, Jan 5, 2015 at 3:20 PM, Harry Putnam wrote: > When running shell commands from perl script with an open() instead of > system() or exec how is the return value snagged. > > I guess, if it doesn't die, it worked but how to snag that information > and at what point? > > --- 8< snip

Re: Get return value when running cmd like this

2015-01-05 Thread Brandon McCaig
Harry: On Mon, Jan 05, 2015 at 06:20:06PM -0500, Harry Putnam wrote: > When running shell commands from perl script with an open() instead of > system() or exec how is the return value snagged. > > I guess, if it doesn't die, it worked but how to snag that information > and at what point? > > -

Get return value when running cmd like this

2015-01-05 Thread Harry Putnam
When running shell commands from perl script with an open() instead of system() or exec how is the return value snagged. I guess, if it doesn't die, it worked but how to snag that information and at what point? --- 8< snip -- 8< snip -- 8', "$log" or die "Can't open $log: $

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
Great thank you! On Fri, Feb 21, 2014 at 6:02 PM, Jim Gibson wrote: > > On Feb 21, 2014, at 6:21 AM, Wernher Eksteen wrote: > > > Hi all, > > > > From the below file names I only need the version number 1.2.4 without > explicitly specifying it. > > > > check_mk-1.2.4.tar.gz > > check_mk-agen

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
lues from all. > > > > > > From that I want to get the value 1.2.4 and assign it to a variable, if > there are more than one value such as 1.2.5 and 1.2.6 as well, it should > print them too, but only the unique values. > > > > My attempt shown below to print only

Re: regex to get version from file name

2014-02-23 Thread Jim Gibson
.5 and 1.2.6 to print the > unique values from all. > > > From that I want to get the value 1.2.4 and assign it to a variable, if there > are more than one value such as 1.2.5 and 1.2.6 as well, it should print them > too, but only the unique values. > > My attempt shown

Re: regex to get version from file name

2014-02-23 Thread Jim Gibson
On Feb 21, 2014, at 6:21 AM, Wernher Eksteen wrote: > Hi all, > > From the below file names I only need the version number 1.2.4 without > explicitly specifying it. > > check_mk-1.2.4.tar.gz > check_mk-agent-1.2.4-1.noarch.rpm > check_mk-agent-logwatch-1.2.4-1.noarch.rpm > check_mk-agent-

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
ss details? foreach my $i (@fileList2) { my $file = "$url/$i" if $i =~ m/$getMenuItem/g; chomp($file); my $ff = File::Fetch->new(uri => "$file"); my $where = $ff->fetch() or die $ff->error; } Thanks, Wernher On Sun, Feb 23, 2014 at 4:35 PM, shawn wilson

Re: regex to get version from file name

2014-02-23 Thread shawn wilson
Use LWP to get web data - not lynx and the like unless you can't help it. I prefer using Web::Scraper to parse html but either way it's probably best not to use a regex (see SO and similar for discussions on the like). On Feb 23, 2014 8:13 AM, "Wernher Eksteen" wrote: > &g

Re: regex to get version from file name

2014-02-23 Thread Wernher Eksteen
im of this script is to connect to the site, remove all html tags and obtain only the file names I need. #!/usr/bin/perl use strict; use warnings; *# initiating package names to be used later*my @getList; my @fileList; *# get files using lynx and parse through it*my $url = " http://math

Re: regex to get version from file name

2014-02-21 Thread Shawn H Corey
On Fri, 21 Feb 2014 16:21:57 +0200 Wernher Eksteen wrote: > Hi all, > > From the below file names I only need the version number 1.2.4 without > explicitly specifying it. > > check_mk-1.2.4.tar.gz > check_mk-agent-1.2.4-1.noarch.rpm > check_mk-agent-logwatch-1.2.4-1.noarch.rpm > check_mk-ag

regex to get version from file name

2014-02-21 Thread Wernher Eksteen
Hi all, >From the below file names I only need the version number 1.2.4 without explicitly specifying it. check_mk-1.2.4.tar.gz check_mk-agent-1.2.4-1.noarch.rpm check_mk-agent-logwatch-1.2.4-1.noarch.rpm check_mk-agent-oracle-1.2.4-1.noarch.rpm mk-livestatus-1.2.4.tar.gz mkeventd-1.2.4.tar

Re: baby perl to get the right date

2014-01-30 Thread Jim Gibson
On Jan 27, 2014, at 11:32 PM, Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3..5]; > $month++, $year += 1900; > print "\nToday is $month / $day

Re: baby perl to get the right date

2014-01-29 Thread SSC_perl
On Jan 28, 2014, at 8:59 PM, Rob Dixon wrote: > It is probably best to use the Time::Piece module, which has been part of > core Perl 5 since version 10 Side question: does anyone know why the Perl team chose Time::Piece over Date::Time to be bundled with Perl? I've known about Date::Ti

Re: baby perl to get the right date

2014-01-28 Thread Luca Ferrari
On Wed, Jan 29, 2014 at 5:59 AM, Rob Dixon wrote: > It is probably best to use the Time::Piece module, which has been part of > core Perl 5 since version 10 so you shouldn't need to install it. > Thanks, I was not aware of it. And it does what I need. Luca -- To unsubscribe, e-mail: beginners-

Re: baby perl to get the right date

2014-01-28 Thread Rob Dixon
On 28/01/2014 07:32, Luca Ferrari wrote: Hi all, often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there

Re: baby perl to get the right date

2014-01-28 Thread David Precious
On Tue, 28 Jan 2014 08:32:20 +0100 Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3..5]; > $month++, $year += 1900; > print "\nToday is $mon

Re: baby perl to get the right date

2014-01-28 Thread Dr.Ruud
On 2014-01-28 08:32, Luca Ferrari wrote: often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there's

Re: baby perl to get the right date

2014-01-27 Thread marcos rebelo
all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $month, $year) = (localtime())[3..5]; > $month++, $year += 1900; > print "\nToday is $month / $day / $year \n"; > > > I was wondering if there's a

Re: baby perl to get the right date

2014-01-27 Thread Chankey Pathak
Hi Luca, Check this: http://stackoverflow.com/questions/11020812/todays-date-in-perl-in-mm-dd--format On 28 January 2014 13:02, Luca Ferrari wrote: > Hi all, > often I find myself writing something like the following to get the > "human" date: > > my ($day, $m

baby perl to get the right date

2014-01-27 Thread Luca Ferrari
Hi all, often I find myself writing something like the following to get the "human" date: my ($day, $month, $year) = (localtime())[3..5]; $month++, $year += 1900; print "\nToday is $month / $day / $year \n"; I was wondering if there's a smarter pattern to get the right

Re: trying to get line-by-line output of a command pipe in perl

2013-12-26 Thread Kenneth Wolcott
On Thu, Dec 26, 2013 at 5:34 PM, John W. Krahn wrote: > Kenneth Wolcott wrote: >> >> Hello; > > > Hello Kenneth, > > > >>I'm trying to obtain line-by-line output from a command pipe in perl. >> >>Unfortunately, I am firmly held to 5.8.8 version of perl on this >> specific machine :-( >> >>

Re: trying to get line-by-line output of a command pipe in perl

2013-12-23 Thread Shlomi Fish
you use an array, it is _not_ sent thru the shell. Try the > three-argument open: > > open my $fh, '-|', @cmd or die "blah: $!\n"; fails, "Unknown open() > mode '5'"; That won't get sent through the shell either: [SHELL] shlomif[

Re: trying to get line-by-line output of a command pipe in perl

2013-12-23 Thread Shawn H Corey
On Mon, 23 Dec 2013 15:02:13 -0800 Kenneth Wolcott wrote: > open my $fh, @cmd, "|" or die "blah: $!\n"; fails, "Unknown open() > mode '5'" If you use an array, it is _not_ sent thru the shell. Try the three-argument open: open my $fh, '-|', @cmd or die "blah: $!\n"; fails, "Unknown open()

trying to get line-by-line output of a command pipe in perl

2013-12-23 Thread Kenneth Wolcott
Hello; I'm trying to obtain line-by-line output from a command pipe in perl. Unfortunately, I am firmly held to 5.8.8 version of perl on this specific machine :-( Apparently, creating an array for my command prevents me from including the final pipe symbol when trying to use the three-argu

Re: is it possible to get only emails from this list for threads that I've started or replied ?

2013-05-28 Thread Jim Gibson
y email and those from threads in which there is my reply also be > send like on web forum when you subscribe to thread you get only > reminders of that thread and not whole forum. > Yesterday I subscribed to two email list from perl and now in the > morning I got 31 message

Re: is it possible to get only emails from this list for threads that I've started or replied ?

2013-05-28 Thread R. S.
rum when you subscribe to thread you get only reminders of that thread and not whole forum. Yesterday I subscribed to two email list from perl and now in the morning I got 31 messages whom majority I'm not interested in. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For ad

Re: is it possible to get only emails from this list for threads that I've started or replied ?

2013-05-27 Thread Gustavo Telly
How do you will reply a message, if you will not receive it ? 2013/5/27 R. S. > I've send request to beginners-help but there seems to be no such > command. > > > -- > To unsubscribe, e-mail: beginners-unsubscr...@perl.org > For additional commands, e-mail: beginners-h...@perl.org > http:/

is it possible to get only emails from this list for threads that I've started or replied ?

2013-05-27 Thread R. S.
I've send request to beginners-help but there seems to be no such command. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: How to get the file handle of a scalar

2012-07-31 Thread Andy Bach
On Mon, Jul 30, 2012 at 6:32 PM, Jenda Krynicky wrote: > > Just to prevent confusion ... the "use autodie" is not needed to be > able to open a "filehandle into a string". ... > It forces some Perl builtins to throw an exception instead of > reporting success or failure using their return values.

Re: How to get the file handle of a scalar

2012-07-30 Thread Jenda Krynicky
From: Shlomi Fish > Hi Thomas, > > On Mon, 30 Jul 2012 20:23:58 +0800 > Thomas Dean wrote: > > > Hi there, > > > > I'm wondering how to get the file handle or a reference of a file > > object of a scalar in which stores a string. > > > &g

Re: How to get the file handle of a scalar

2012-07-30 Thread Shlomi Fish
Hi Thomas, On Mon, 30 Jul 2012 20:23:58 +0800 Thomas Dean wrote: > Hi there, > > I'm wondering how to get the file handle or a reference of a file > object of a scalar in which stores a string. > Starting from relatively recent versions of Perl, you can simply do: use

How to get the file handle of a scalar

2012-07-30 Thread Thomas Dean
Hi there, I'm wondering how to get the file handle or a reference of a file object of a scalar in which stores a string. Thanks, Thomas -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

How to get Sybase server output

2012-07-19 Thread Ramit Gupta
Hi, I am executing a Sybase stored procedure using 'nsql'. Now I want to capture entire server output (NOT just value of output parameters) via my perl script. Please let me know how to do that? *Piece of code that I am using:* use Sybase::DBlib; my $dbh = new Sybase::DBlib $dbUserName, $dbPass

Re: how to get a sequence of 01 02 ..

2012-06-11 Thread Shawn H Corey
On 12-06-11 11:04 AM, lina wrote: #!/usr/bin/env perl use strict; use warnings; use autodie qw(open close); use Carp qw(croak); use 5.012; my $tra=7; my @files=("01".."40"); foreach(@files){ $tra=process_onefile("replica_index_$_.xvg"); } sub process_onefile{ my $b

Re: how to get a sequence of 01 02 ..

2012-06-11 Thread lina
On Mon, Jun 11, 2012 at 10:42 PM, Brian Fraser wrote: > On Mon, Jun 11, 2012 at 10:49 AM, lina wrote: >> >> Hi, >> >> >> $  for i in `seq -f '%02g' 1 10` ; do echo $i ; done >> 01 >> 02 >> 03 >> 04 >> 05 >> 06 >&g

Re: how to get a sequence of 01 02 ..

2012-06-11 Thread Brian Fraser
On Mon, Jun 11, 2012 at 10:49 AM, lina wrote: > Hi, > > > $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done > 01 > 02 > 03 > 04 > 05 > 06 > 07 > 08 > 09 > 10 > > I wonder how can I get something like above in the perl. > > for my $i ("01".."10") { say $i; }

Re: how to get a sequence of 01 02 ..

2012-06-11 Thread Shlomi Fish
Hi, On Mon, 11 Jun 2012 07:10:07 -0700 "Ron Bergin" wrote: > >lina wrote: > > Hi, > > > > > > $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done > > 01 > > 02 > > 03 > > 04 > > 05 > > 06 > > 07 > &g

Re: how to get a sequence of 01 02 ..

2012-06-11 Thread Ron Bergin
>lina wrote: > Hi, > > > $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done > 01 > 02 > 03 > 04 > 05 > 06 > 07 > 08 > 09 > 10 > > I wonder how can I get something like above in the perl. > perl -e "for (1..10){printf(qq

RE: how to get a sequence of 01 02 ..

2012-06-11 Thread Jack Maney
How about: use strict; use warnings; foreach my $i(1..10){$i="0" . $i if length($i)==1;print "$i\n";} -Original Message- From: lina [mailto:lina.lastn...@gmail.com] Sent: Monday, June 11, 2012 8:49 AM To: beginners@perl.org Subject: how to get a sequence of 01 02 .

how to get a sequence of 01 02 ..

2012-06-11 Thread lina
Hi, $ for i in `seq -f '%02g' 1 10` ; do echo $i ; done 01 02 03 04 05 06 07 08 09 10 I wonder how can I get something like above in the perl. Thanks ahead for your suggestions, Best regards, -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional comman

Re: Perl HTTP Get

2012-05-30 Thread John W. Krahn
Chris Nehren wrote: On Wed, May 30, 2012 at 16:22:29 -0500 , Matt wrote: I did this. Snippet from larger code: eval { $rststr = ""; local $SIG{ALRM} = sub { die "get timeout" }; alarm(30); $rststr = get("http://"; . $dst .

Re: Perl HTTP Get

2012-05-30 Thread Chris Nehren
On Wed, May 30, 2012 at 16:22:29 -0500 , Matt wrote: > I did this. Snippet from larger code: > > eval { > $rststr = ""; > local $SIG{ALRM} = sub { die "get timeout" }; > alarm(30); > $rststr = get("http://";

Re: Perl HTTP Get

2012-05-30 Thread Matt
>> Thanks.  Yes, using Simple.  Looking at this. >> >> Can I do something as simple as this? >> >> $rststr = ""; >> alarm(60); # set timer for 60 seconds >> $rststr = get("http://"; . $dst . "/request.htm" ); # try to get my

Re: Perl HTTP Get

2012-05-30 Thread Chris Nehren
On Tue, May 29, 2012 at 21:45:16 -0500 , Matt wrote: > Thanks. Yes, using Simple. Looking at this. > > Can I do something as simple as this? > > $rststr = ""; > alarm(60); # set timer for 60 seconds > $rststr = get("http://"; . $dst . "/request.h

Re: Perl HTTP Get

2012-05-29 Thread Matt
>> I have a line like this: >> >> $rststr = get("http://"; . $dst . "/request.htm" ); >> >> Problem is that I have had this script hang due to the $dst site being >> down. Is there a way to do a time out? > > Consider using the core al

Re: Perl HTTP Get

2012-05-27 Thread Chris Nehren
On Sun, May 27, 2012 at 14:00:34 -0500 , Matt wrote: > I have a line like this: > > $rststr = get("http://"; . $dst . "/request.htm" ); > > Problem is that I have had this script hang due to the $dst site being > down. Is there a way to do a time out? Co

Perl HTTP Get

2012-05-27 Thread Matt
I have a line like this: $rststr = get("http://"; . $dst . "/request.htm" ); Problem is that I have had this script hang due to the $dst site being down. Is there a way to do a time out? -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands,

Re: how to get two matches out

2012-05-03 Thread Paul Johnson
On Sun, Apr 29, 2012 at 11:10:33AM -0500, Lawrence Statton wrote: > From perlretut, I quote: > >In list context, "//g" returns a list of matched groupings, >or if there are no groupings, a list of matches to >the whole regexp. So if we wanted just the words, we could use

Re: how to get two matches out

2012-04-30 Thread Shawn H Corey
On 12-04-29 10:12 PM, lina wrote: P.S seems we don't have the same perldoc. Try this one: http://perldoc.perl.org/ -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. [updated for today's programmers] "Show

Re: how to get two matches out

2012-04-29 Thread lina
Thanks for Lawrence's crystal clear explaination and Shawn's reply. I understand now, best regards, P.S seems we don't have the same perldoc. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

Re: how to get two matches out

2012-04-29 Thread Lawrence Statton
# $word[1] = 'dog' # $word[2] = 'house' (Note that the docs (at least on my copy of perl) have a typo ... it says @words, not @word.) So - let's take a quick pass at your problem, breaking it down into pieces. First -

Re: how to get two matches out

2012-04-29 Thread Shawn H Corey
On 12-04-29 11:41 AM, lina wrote: if($_ =~ m/cite\{(.+?)\}/g){ Not work. while( $_ =~ m/cite\{(.+?)\}/g ){ -- Just my 0.0002 million dollars worth, Shawn Programming is as much about organization and communication as it is about coding. [updated for today's programmers] "Show me your

Re: how to get two matches out

2012-04-29 Thread lina
On Sun, Apr 29, 2012 at 11:26 PM, Lawrence Statton wrote: > On 04/29/2012 10:21 AM, lina wrote: >> >> Hi, >> >> I have a text file like: >> >> $ more sample.tex >> >> aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} >> bbb\cite{inhibitor}aaa >> >> >> sub read_tex{ >>        open my $fh, '<', @_;

Re: how to get two matches out

2012-04-29 Thread Lawrence Statton
On 04/29/2012 10:21 AM, lina wrote: Hi, I have a text file like: $ more sample.tex aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} bbb\cite{inhibitor}aaa sub read_tex{ open my $fh, '<', @_; while(<$fh>){ if(/cite\{(.+?)\}/){ push @citeditems

how to get two matches out

2012-04-29 Thread lina
Hi, I have a text file like: $ more sample.tex aaa \cite{d1,d2},ddd \cite{e1},ccc \cite{f1,f2,f3} bbb\cite{inhibitor}aaa sub read_tex{ open my $fh, '<', @_; while(<$fh>){ if(/cite\{(.+?)\}/){ push @citeditems,split/,/,$1; }

Re: get information from server

2012-04-22 Thread David Christensen
On 04/22/2012 09:29 AM, lina wrote: How do I use ssh p3600 'top' It shows me TERM environment variable not set. Please read the manual page for top: $ man top Try the "batch mode operation" and "number of iterations" options: $ ssh p3600 top -b -n 1 HTH, David -- To unsubscribe,

Re: get information from server

2012-04-22 Thread lina
On Sunday 22,April,2012 06:20 AM, David Christensen wrote: On 04/21/2012 07:51 AM, lina wrote: Thanks, I didn't realize that the ssh p3600 'do something' can do something without being in the server. Yes -- providing a command to ssh is a very useful. Check out the manual page for more informa

Re: get information from server

2012-04-21 Thread David Christensen
On 04/21/2012 07:51 AM, lina wrote: Thanks, I didn't realize that the ssh p3600 'do something' can do something without being in the server. Yes -- providing a command to ssh is a very useful. Check out the manual page for more information: $ man ssh Taking it one step further, anythi

Re: get information from server

2012-04-21 Thread Jim Gibson
On Apr 20, 2012, at 5:42 AM, lina wrote: > Hi, > > I used to ssh Mars (servers's name) and then cd to some directory and check > some file's modification time. > > Can I do it locally with perl, without ssh? > > What I came so far is equal to null, but I am still google-ing. > > Thanks ahead

Re: get information from server

2012-04-21 Thread lina
ome way to read the mtime of the file on the remote host. If you get to the host via SSH, then you're going to need a Perl SSH module... As an alternative, you can use ssh from the command line to run a Perl one-liner on a remote host (p3600) that prints the modification time of a file (.bashrc

Re: get information from server

2012-04-20 Thread David Christensen
On 04/20/2012 05:42 AM, lina wrote: I used to ssh Mars (servers's name) and then cd to some directory and check some file's modification time. Can I do it locally with perl, without ssh? A local Perl script will need some way to read the mtime of the file on the remote host. If

get information from server

2012-04-20 Thread lina
Hi, I used to ssh Mars (servers's name) and then cd to some directory and check some file's modification time. Can I do it locally with perl, without ssh? What I came so far is equal to null, but I am still google-ing. Thanks ahead for your suggestions or template that I can work on. Best r

Re: May I get help?

2012-04-17 Thread Jim Gibson
On Apr 15, 2012, at 8:51 PM, Rassoul Aleshi wrote: > > > > > Hello list managerl > > I am trying to get this simple peogram to call server function and return > data and it does not work, is here anyone can help? > > #!/usr/bin/perl2. > use stric

May I get help?

2012-04-17 Thread Rassoul Aleshi
  Hello list managerl I am trying to get this simple peogram to call server function and return data and it does not work, is here anyone can help?   #!/usr/bin/perl2. use strict;3. use warnings; $i= "value";   fo

Re: Why do I get a warning?

2012-03-26 Thread Manfred Lotz
On Mon, 26 Mar 2012 20:58:43 +0200 Paul Johnson wrote: > On Mon, Mar 26, 2012 at 06:10:08PM +0200, Manfred Lotz wrote: > > On 25 Mar 2012 13:11:16 - > > Peter Scott wrote: > > > > > On Thu, 22 Mar 2012 20:06:35 -0400, Uri Guttman wrote: > > > > no one uses braces for single scalar handles

Re: Why do I get a warning?

2012-03-26 Thread Paul Johnson
On Mon, Mar 26, 2012 at 06:10:08PM +0200, Manfred Lotz wrote: > On 25 Mar 2012 13:11:16 - > Peter Scott wrote: > > > On Thu, 22 Mar 2012 20:06:35 -0400, Uri Guttman wrote: > > > no one uses braces for single scalar handles in general. > > > > I do. Ever since Damian recommended it (Perl Be

Re: Why do I get a warning?

2012-03-26 Thread Manfred Lotz
On 25 Mar 2012 13:11:16 - Peter Scott wrote: > On Thu, 22 Mar 2012 20:06:35 -0400, Uri Guttman wrote: > > no one uses braces for single scalar handles in general. > > I do. Ever since Damian recommended it (Perl Best Practices, page > 217). One of those numerous times I didn't agree with h

Re: Why do I get a warning?

2012-03-25 Thread Uri Guttman
On 03/25/2012 09:11 AM, Peter Scott wrote: On Thu, 22 Mar 2012 20:06:35 -0400, Uri Guttman wrote: no one uses braces for single scalar handles in general. I do. Ever since Damian recommended it (Perl Best Practices, page 217). One of those numerous times I didn't agree with him until I trie

Re: Why do I get a warning?

2012-03-25 Thread Peter Scott
On Thu, 22 Mar 2012 20:06:35 -0400, Uri Guttman wrote: > no one uses braces for single scalar handles in general. I do. Ever since Damian recommended it (Perl Best Practices, page 217). One of those numerous times I didn't agree with him until I tried it, then found he was right. -- Peter S

Re: Why do I get a warning?

2012-03-23 Thread Manfred Lotz
On Fri, 23 Mar 2012 02:35:28 -0400 Uri Guttman wrote: > On 03/23/2012 12:21 AM, Manfred Lotz wrote: > > On Thu, 22 Mar 2012 20:06:35 -0400 > > Uri Guttman wrote: > > > > My idea behind using always braces was that then I'm always sure > > Perl does the right thing. > > > > it is hard to make

Re: Why do I get a warning?

2012-03-22 Thread Uri Guttman
On 03/23/2012 12:21 AM, Manfred Lotz wrote: On Thu, 22 Mar 2012 20:06:35 -0400 Uri Guttman wrote: My idea behind using always braces was that then I'm always sure Perl does the right thing. it is hard to make perl do the wrong thing with print and handles. in fact there are many ways to

Re: Why do I get a warning?

2012-03-22 Thread Manfred Lotz
On Thu, 22 Mar 2012 20:06:35 -0400 Uri Guttman wrote: > On 03/22/2012 05:49 PM, Manfred Lotz wrote: > > > > > In documentation about 'open' I found: > > > > Note that if you're storing FILEHANDLEs in an array, or if > > you're using any other expression more complex than > > a sc

Re: Why do I get a warning?

2012-03-22 Thread Uri Guttman
On 03/22/2012 05:49 PM, Manfred Lotz wrote: In documentation about 'open' I found: Note that if you're storing FILEHANDLEs in an array, or if you're using any other expression more complex than a scalar variable to retrieve it, you will have to use a block returning

  1   2   3   4   5   6   7   8   9   10   >