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? > > -

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
On Saturday 21,April,2012 02:42 AM, David Christensen wrote: 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

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 you get to the

Re: Get variable name from a list

2010-07-25 Thread C.DeRykus
> ... > 2010/7/24 Mike Martin : > > This is how I worked round the issue (didn't think of hash slice) > > foreach my $w (qw/$file_start $file_time $video_track $audio_track > $quality $sync $sync_box $qual_box $vid_box $aud_box $time_label > $times $file_hbox/) #Use qw to turn variable name int

Re: Get variable name from a list

2010-07-24 Thread Jeff Pang
2010/7/24 Mike Martin : >> > > This is how I worked round the issue (didn't think of hash slice) > > foreach my $w (qw/$file_start $file_time $video_track $audio_track > $quality $sync $sync_box $qual_box $vid_box $aud_box $time_label > $times $file_hbox/) #Use qw to turn variable name into a stri

Re: Get variable name from a list

2010-07-24 Thread Uri Guttman
> "JP" == Jeff Pang writes: JP> 2010/7/24 Mike Martin : >> Is this possible? >> >> I am trying to populate a hash with keys as variable name and value as >> variable value eg: >> my %hash; >> foreach my $w ($filename,$file_start,$file_time,$video_track,$audio_track,$quality,$s

Re: Get variable name from a list

2010-07-24 Thread Jeff Pang
2010/7/24 Mike Martin : > Is this possible? > > I am trying to populate a hash with keys as variable name and value as > variable value eg: > my %hash; > foreach my $w > ($filename,$file_start,$file_time,$video_track,$audio_track,$quality,$sync){ > my $hash{$key}=  $w; > That would be a hash slic

Re: get acl's of directory

2010-06-08 Thread Eric Veith1
"Chas. Owens" wrote on 06/08/2010 02:00:28 PM: > On Wed, Apr 28, 2010 at 01:52, Andreas Moroder > wrote: > snip > > "Can't build and link to 'attr'" > > > > Does anyone know what causes this error ? > snip > > My first bet is that you don't have a C compiler installed, but I > really can't tell u

Re: get acl's of directory

2010-06-08 Thread Eric Veith1
Prasaad Kulkarni wrote on 06/08/2010 02:49:32 PM: > nfsv4 supports acl in linux. > getacls and facls can be look out for. > > On Tue, Jun 8, 2010 at 5:26 PM, Chas. Owens wrote: > > > On Tue, Jun 1, 2010 at 17:20, Jenda Krynicky wrote: > > > From: Andreas Moroder > > > Hello,

Re: get acl's of directory

2010-06-08 Thread Prasaad Kulkarni
nfsv4 supports acl in linux. getacls and facls can be look out for. On Tue, Jun 8, 2010 at 5:26 PM, Chas. Owens wrote: > On Tue, Jun 1, 2010 at 17:20, Jenda Krynicky wrote: > > From: Andreas Moroder > > Hello, > >> > >> is it possible to get the acl entrie of a directory on

Re: get acl's of directory

2010-06-08 Thread Chas. Owens
On Wed, Apr 28, 2010 at 01:52, Andreas Moroder wrote: snip > "Can't build and link to 'attr'" > > Does anyone know what causes this error ? snip My first bet is that you don't have a C compiler installed, but I really can't tell unless you post the output of make. -- Chas. Owens wonkden.net The

Re: get acl's of directory

2010-06-08 Thread Chas. Owens
On Tue, Jun 1, 2010 at 17:20, Jenda Krynicky wrote: > From:                   Andreas Moroder >  Hello, >> >> is it possible to get the acl entrie of a directory on linux with perl ? >> >> Thanks >> Andreas > > What do you mean by "acl"? Access Control List? There is no such > thing under Linux,

Re: get acl's of directory

2010-06-01 Thread Jenda Krynicky
From: Andreas Moroder Hello, > > is it possible to get the acl entrie of a directory on linux with perl ? > > Thanks > Andreas What do you mean by "acl"? Access Control List? There is no such thing under Linux, the permissions system works differently there. Jenda = je.

Re: get acl's of directory

2010-04-27 Thread Andreas Moroder
Andreas Moroder schrieb: Hello, is it possible to get the acl entrie of a directory on linux with perl ? Thanks Andreas Hello, probably I have found the module I need, it is File-ExtAttr but I when i start perl Makefile.pl I get this error "Can't build and link to 'attr'" Does anyone know

Re: get path to linked directory

2010-04-27 Thread Shawn H Corey
Andreas Moroder wrote: Hello, I have a entry in my directory that is a soft-link to another directory. Is there a way in perl to get, starting from the link, the path of the real directory ? Thanks Andreas See: perldoc -f readlink http://perldoc.perl.org/functions/readlink.html perldoc -

RE: Get result of a https page with SSL after login.

2010-03-30 Thread Bob McConnell
From: chew23 > To automate my work i have to get a html page by my company site after a > login in an secure area. > After a long googling job, I decided to use WWW:Selenium to do this. > It seems to be bugged and i would ask to you if there is e clear method > to do this. I believe the first s

Re: Get the page from a server that uses DotNet

2010-02-24 Thread haliphax
On Sat, Feb 20, 2010 at 6:24 PM, Uri Guttman wrote: > > "IP" == Ion Pop writes: > > IP> There is a page which is created using DotNet and there is a > IP> paginated table in it. I want to download the next pages from > IP> that table, but the links to those pages use the DoPostBack JS >

Re: Get the page from a server that uses DotNet

2010-02-20 Thread Uri Guttman
> "IP" == Ion Pop writes: IP> There is a page which is created using DotNet and there is a IP> paginated table in it. I want to download the next pages from IP> that table, but the links to those pages use the DoPostBack JS IP> function which is probably created automaticly by DotNet

Re: Get the page from a server that uses DotNet

2010-02-20 Thread Shlomi Fish
Hi Ion Pop! On Saturday 20 Feb 2010 12:25:10 Ion Pop wrote: > Hi, > > There is a page which is created using DotNet and there is a paginated > table in it. > I want to download the next pages from that table, but the links to those > pages use the DoPostBack JS function which is probably created

Re: get list of files sorted by date

2009-09-29 Thread Jeff Peng
2009/9/29 Andreas Moroder : > Hello, > > according to the man glob can only sort by name. Is there a way to get a > list of files sorted by date ? > sure. first I will use unix's ls command like ls -ltr. in perl one of the ways: my @sorted = map { $_->[0] } sort { $a->[1] <=> $b->[1]

Re: get list of files sorted by date

2009-09-29 Thread Алексеев Александр
print join "\n", sort {(stat $a)[8] <=> (stat $b)[8]} glob "./*"; -- Alexandr A Alexeev http://www.unixcommunity.net/ Andreas Moroder пишет: Hello, according to the man glob can only sort by name. Is there a way to get a list of files sorted by date ? Bye Andreas -- To unsubscribe, e-m

Re: get localhost's IPAddr

2009-05-05 Thread Jenda Krynicky
Date sent: Tue, 5 May 2009 14:46:29 +0800 Subject:get localhost's IPAddr From: practicalp...@gmail.com To: Perl Beginners > Hello, > > Is there a perl way to get the IP addresses set on local host, other > than parse data from if

Re: get localhost's IPAddr

2009-05-05 Thread Stanisław T. Findeisen
practicalp...@gmail.com wrote: Is there a perl way to get the IP addresses set on local host, other than parse data from ifconfig's output? Often there's more than one. STF === http://eisenbits.homelinux.net/~stf/ OpenPGP: DF

Re: get function name?

2008-10-01 Thread Bryan R Harris
>> Is it possible from within a function to get the name of the function I'm >> in? e.g. >> >> ** >> sub function23 { return "I am in function $\n"; } >> >> print function23(); >> ** >> >> ... should return "I am in funct

Re: get function name?

2008-10-01 Thread John W. Krahn
Bryan R Harris wrote: Is it possible from within a function to get the name of the function I'm in? e.g. ** sub function23 { return "I am in function $\n"; } print function23(); ** ... should return "I am in function fun

Re: Get the last entry of log file

2008-09-23 Thread Olteanu Eugen
Maybe this helps : tail -1 file and redirect the output to a file. On Mon, Sep 22, 2008 at 10:46 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: > Mr. Shawn H. Corey wrote: > >> On Wed, 2008-09-17 at 13:18 +0100, Stewart Anderson wrote: >> >>> How about a system(tail -x inputfile >> mylastfile)

Re: Get the last entry of log file

2008-09-22 Thread John W. Krahn
Mr. Shawn H. Corey wrote: On Wed, 2008-09-17 at 13:18 +0100, Stewart Anderson wrote: How about a system(tail -x inputfile >> mylastfile)type call to get the last line and then open the mylastfile to work on the line there? The UNIX utility tail(1) still reads the entire file. The

Re: Get the last entry of log file

2008-09-17 Thread John W. Krahn
Manasi Bopardikar wrote: I have a log file- [ snip ] How can I get the last entry of this file? use File::ReadBackwards; my $bw = File::ReadBackwards->new( 'log_file' ) or die "can't read 'log_file' $!"; my $last_line = $bw->readline; John -- Perl isn't a toolbox, but a small machine

RE: Get the last entry of log file

2008-09-17 Thread Mr. Shawn H. Corey
On Wed, 2008-09-17 at 13:18 +0100, Stewart Anderson wrote: > How about a system(tail -x inputfile >> mylastfile)type call to > get the last line and then open the mylastfile to work on the line > there? > The UNIX utility tail(1) still reads the entire file. -- Just my 0.0002 mil

Re: Get the last entry of log file

2008-09-17 Thread Mr. Shawn H. Corey
On Wed, 2008-09-17 at 13:55 +0200, Rob Coops wrote: > my $last_line; > while( <> ){ > $last_line = $_; > } > > Sure... depends on the size of the log, though. Do that for a log that > is > say 500MB in size and you are in for quite a wait as it will loop over > each > line in the file will it not

Re: Get the last entry of log file

2008-09-17 Thread Hridyesh Pant
try this... perl -ne'$l = $_; END { print $l }' /tmp/1.txt --Hridyesh Stewart Anderson wrote: From: Rob Coops [mailto:[EMAIL PROTECTED] Sent: 17 September 2008 12:55 To: Mr. Shawn H. Corey Cc: Manasi Bopardikar; beginners@perl.org Subject: Re: Get the last entry of log file my

RE: Get the last entry of log file

2008-09-17 Thread Stewart Anderson
> From: Rob Coops [mailto:[EMAIL PROTECTED] > Sent: 17 September 2008 12:55 > To: Mr. Shawn H. Corey > Cc: Manasi Bopardikar; beginners@perl.org > Subject: Re: Get the last entry of log file > > my $last_line; > while( <> ){ > $last_line = $_; > } > &

Re: Get the last entry of log file

2008-09-17 Thread Rob Coops
my $last_line; while( <> ){ $last_line = $_; } Sure... depends on the size of the log, though. Do that for a log that is say 500MB in size and you are in for quite a wait as it will loop over each line in the file will it not? On Wed, Sep 17, 2008 at 1:46 PM, Mr. Shawn H. Corey <[EMAIL PROTECTED

Re: Get the last entry of log file

2008-09-17 Thread Mr. Shawn H. Corey
On Wed, 2008-09-17 at 15:41 +0530, Manasi Bopardikar wrote: > I have a log file- > > | 15 Sep 2008 - 06:37 | TWikiGuest | view | TWiki.WebHome | Mozilla | > 10.88.68.26 | > > | 15 Sep 2008 - 06:37 | TWikiGuest | view | TWiki.TWikiFAQ | Mozilla | > 10.88.68.26 | > > | 15 Sep 2008 - 06:38 | TWik

Re: Get the last entry of log file

2008-09-17 Thread Rob Coops
m/([0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3})/ Should do the trick I guess of course there are fancier ways but this will do the trick... Regards, Rob On Wed, Sep 17, 2008 at 12:11 PM, Manasi Bopardikar < [EMAIL PROTECTED]> wrote: > I have a log file- > > | 15 Sep 2008 - 06:37 | TWiki

Re: get external IP address

2008-08-22 Thread John W. Krahn
William wrote: Hello, Hello, if I want to make an application to allow user find their WAN IP address, what are the available options in Perl ? I have searched around. perldoc -q "How do I find out my hostname, domainname, or IP address?" John -- Perl isn't a toolbox, but a small machine

Re: Get Clients Windows Logon ID

2008-07-16 Thread Rob Dixon
Mimi Cafe wrote: > > The question is about CGI environment variables and perl CGI.pm for that > matter, so he should be able to ask this list for help. I don't think anyone suggested that he shouldn't be asking the list for help did they? > Also, this is not server specific. It's same on Apache

Re: Get Clients Windows Logon ID

2008-07-16 Thread Mimi Cafe
The question is about CGI environment variables and perl CGI.pm for that matter, so he should be able to ask this list for help. Also, this is not server specific. It's same on Apache and IIS. The remote_user() or user_name() is only set when the visitor is required by the web server to authentica

Re: Get Clients Windows Logon ID

2008-07-16 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > Can you let me know how configure my IIS web server in order to get > $ENV{LOGIN_USER} or $ENV{AUTH_USER} ? That isn't a Perl question and doesn't belong here. You should ask your IIS system operator, and if you don't have one there is plenty of documentation on IIS

Re: Get Clients Windows Logon ID

2008-07-16 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > Below is the code I try in my apache server at windows XP, but it > return null for both remote_user() or user_name(). > > #!C:\Perl\bin\perl > use CGI; > my $query = new CGI; > my $userName= $query->user_name(); > my $remoteUser = $query->remote_user(); > print "Con

Re: Get Clients Windows Logon ID

2008-07-16 Thread leolim818
On Jul 16, 12:54 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > > > On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > >> [EMAIL PROTECTED] wrote: > > >>> On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > How is this Perl programming being run? It

Re: Get Clients Windows Logon ID

2008-07-16 Thread leolim818
On Jul 15, 11:36 pm, [EMAIL PROTECTED] (Mimi Cafe) wrote: > remote_user() or user_name() should give you the name of the user if you are > using CGI.pm. > > Mimi > > On 15/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > > > > > > On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote: >

Re: Get Clients Windows Logon ID

2008-07-16 Thread Mimi Cafe
Someone in Timbuktu goes to your web site using their favourite browser and you want to know their authenticated user name, it that right? The user's web browser sends this information to your web application and assuming you are using CGI.pm you can say: $remote_user_login = remote_user(); In t

Re: Get Clients Windows Logon ID

2008-07-15 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote: >> >> [EMAIL PROTECTED] wrote: >> >>> On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote: How is this Perl programming being run? It looks like it's a CGI program or being run from a schedul

Re: Get Clients Windows Logon ID

2008-07-15 Thread Mimi Cafe
remote_user() or user_name() should give you the name of the user if you are using CGI.pm. Mimi On 15/07/2008, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > > On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > [EMAIL PROTECTED] wrote: > > > > > On Jul 15, 12:32 am, [EMAIL PROTECTED]

Re: Get Clients Windows Logon ID

2008-07-15 Thread leolim818
On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > > > On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > >> How is this Perl programming being run? It looks like it's a CGI program or > >> being run from a scheduler, in which case the process doesn't

Re: Get Clients Windows Logon ID

2008-07-15 Thread leolim818
On Jul 15, 11:11 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > > > On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > > >> How is this Perl programming being run? It looks like it's a CGI program or > >> being run from a scheduler, in which case the process doesn't

Re: Get Clients Windows Logon ID

2008-07-14 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > > On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote: >> >> How is this Perl programming being run? It looks like it's a CGI program or >> being run from a scheduler, in which case the process doesn't belong to any >> individual user. >> >> What are you trying to a

Re: Get Clients Windows Logon ID

2008-07-14 Thread leolim818
On Jul 15, 12:32 am, [EMAIL PROTECTED] (Rob Dixon) wrote: > [EMAIL PROTECTED] wrote: > > On Jul 11, 11:59 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > >> Amit Saxena wrote: > > >>> On Fri, Jul 11, 2008 at 8:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > Can you pl

Re: Get Clients Windows Logon ID

2008-07-14 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > On Jul 11, 11:59 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: >> Amit Saxena wrote: >> >>> On Fri, Jul 11, 2008 at 8:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: [EMAIL PROTECTED] wrote: > Can you please advice me how to get the Clients' windows logon user > name

Re: Get Clients Windows Logon ID

2008-07-14 Thread leolim818
On Jul 11, 11:59 pm, [EMAIL PROTECTED] (Rob Dixon) wrote: > Amit Saxena wrote: > > > On Fri, Jul 11, 2008 at 8:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > > >> [EMAIL PROTECTED] wrote: > > >>> Can you please advice me how to get the Clients' windows logon user > >>> name in perl? > > >>   $ENV{US

Re: Get Clients Windows Logon ID

2008-07-11 Thread Rob Dixon
Amit Saxena wrote: > > On Fri, Jul 11, 2008 at 8:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: >>> >>> Can you please advice me how to get the Clients' windows logon user >>> name in perl? >> >> $ENV{USERNAME} > > Using environment variables to find username are ris

Re: Get Clients Windows Logon ID

2008-07-11 Thread Amit Saxena
Using environment variables to find username are risky ! Is there any API available for the same ? Thanks & Regards, Amit Saxena On Fri, Jul 11, 2008 at 8:39 PM, Rob Dixon <[EMAIL PROTECTED]> wrote: > > [EMAIL PROTECTED] wrote: > > Hi All, > > > > Can you please advice me how to get the Clients

Re: Get Clients Windows Logon ID

2008-07-11 Thread Rob Dixon
[EMAIL PROTECTED] wrote: > Hi All, > > Can you please advice me how to get the Clients' windows logon user > name in perl? $ENV{USERNAME} Rob -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] http://learn.perl.org/

Re: get the matching regex pattern

2008-03-20 Thread [EMAIL PROTECTED]
On Mar 20, 6:01 am, [EMAIL PROTECTED] (Ram Prasad) wrote: > I have a somewhat strange requirement > I want to find if a regex matched what exactly matched > > to reproduce this > > -- > my @x; > $x[0] = 'chi+ld*'; > $x[1] = '\sjoke'; > > $_=getinput(); # for test assum

Re: get the matching regex pattern

2008-03-20 Thread Chas. Owens
On Thu, Mar 20, 2008 at 2:02 PM, John W. Krahn <[EMAIL PROTECTED]> wrote: snip > > print '$x[', $1 ? '0' : '1', "] matched.\n"; > >print "\$x[", @- - 1, "] matched.\n" snip That only works if we assume that $x[0] and $x[1] are free of captures themselves: #!/usr/bin/perl use

Re: get the matching regex pattern

2008-03-20 Thread John W. Krahn
Gunnar Hjalmarsson wrote: Ram Prasad wrote: I want to find if a regex matched what exactly matched to reproduce this -- my @x; $x[0] = 'chi+ld*'; $x[1] = '\sjoke'; $_=getinput(); # for test assume $_="This is a joke"; if(/($x[0]|$x[1])/){ print "Matched '

Re: get the matching regex pattern

2008-03-20 Thread Chas. Owens
On Thu, Mar 20, 2008 at 1:30 PM, Gunnar Hjalmarsson <[EMAIL PROTECTED]> wrote: snip > if ( /($x[0])|($x[1])/ ) { > print '$x[', $1 ? '0' : '1', "] matched.\n"; > } snip Since you cannot necessarily predict what $x[0] will hold, you should probably be testing $1 for definedness n

Re: get the matching regex pattern

2008-03-20 Thread Gunnar Hjalmarsson
Just posted to clpmisc: Original Message Subject: Re: get the matching regex pattern Date: Thu, 20 Mar 2008 18:44:23 +0100 From: Gunnar Hjalmarsson <[EMAIL PROTECTED]> Newsgroups: comp.lang.perl.misc Ram Prasad wrote: I have a somewhat strange requirement ... You had

Re: get the matching regex pattern

2008-03-20 Thread Gunnar Hjalmarsson
Ram Prasad wrote: I want to find if a regex matched what exactly matched to reproduce this -- my @x; $x[0] = 'chi+ld*'; $x[1] = '\sjoke'; $_=getinput(); # for test assume $_="This is a joke"; if(/($x[0]|$x[1])/){ print "Matched '$1' \n"; }

Re: get the matching regex pattern

2008-03-20 Thread Chas. Owens
On Thu, Mar 20, 2008 at 9:01 AM, Ram Prasad <[EMAIL PROTECTED]> wrote: > I have a somewhat strange requirement > I want to find if a regex matched what exactly matched > > to reproduce this > > -- > my @x; > $x[0] = 'chi+ld*'; > $x[1] = '\sjoke'; > > $_=getinput();

Re: get full month name

2007-12-10 Thread Bertolt Brecht
Thanks Chas and everyone else. The solution worked perfect Bbrecht On Dec 8, 2007 7:35 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: > On Dec 7, 2007 6:10 PM, <[EMAIL PROTECTED]> wrote: > > I'm trying to write a subroutine that returns the full month name, for > > example January, or February whe

Re: get full month name

2007-12-09 Thread Gunnar Hjalmarsson
Jo for Groups and Lists wrote: Can you use Date::Manip ? $fullMonth = &returnFullmonth($month); sub returnFullmonth { use Date::Manip; return UnixDate("2007/$_/01",'%B'); } This will handle feb, 02, or 2 No, it won't handle anything. C:\home>type test.pl use warnings; $TZ

RE: get full month name

2007-12-09 Thread Jo for Groups and Lists
Can you use Date::Manip ? $fullMonth = &returnFullmonth($month); sub returnFullmonth { use Date::Manip; return UnixDate("2007/$_/01",'%B'); } This will handle feb, 02, or 2 but will not handle february itself - so you may want to check first that you are indeed passing in 1-2

Re: get full month name

2007-12-08 Thread Jefferson Kirkland
Well, to go along with the other example(s), here is a way of doing it using the localtime() function: use strict; use warnings; my ($second, $minute, $hour, $dayOfMonth, $month, $yearOffset, $dayOfWeek, $dayOfYear, $daylightSavings) = localtime(); my $monthnum = $month + 1; my %monthname = (

Re: get full month name

2007-12-08 Thread Chas. Owens
On Dec 7, 2007 6:10 PM, <[EMAIL PROTECTED]> wrote: > I'm trying to write a subroutine that returns the full month name, for > example January, or February when I call the subroutine and pass a > scalar, for example $m that could have a value in one of the following > format > > 1. three letter for

Re: get full month name

2007-12-08 Thread Dr.Ruud
[EMAIL PROTECTED] schreef: > I'm trying to write a subroutine that returns the full month name, for > example January, or February when I call the subroutine and pass a > scalar, for example $m that could have a value in one of the following > format > > 1. three letter format, for example jan or

Re: get full month name

2007-12-08 Thread Eric Krause
I'm also a perl newbie, but couldn't you use a hash? Something like: %fullMonth = ( jan => January, feb => February, mar => March, etc...); print "Month: $fullMonth{$month}"; -eric [EMAIL PROTECTED] wrote: I'm trying to write a subroutine that r

Re: Get the byte position of previous line from last line in file

2007-11-06 Thread Gunnar Hjalmarsson
sivasakthi wrote: I have the text file as following, this first line this is the second line this the third line this is the fourth line this is the sixth line this is the seventh line while opening and reading that text file, is it possible to get the byte position of "this is the sixth line"

Re: Get the byte position of previous line from last line in file

2007-11-05 Thread Jeff Pang
-Original Message- >From: sivasakthi <[EMAIL PROTECTED]> > > >while opening and reading that text file, is it possible to get the byte >position of "this is the sixth line" ?? > Yes. see perldoc -f tell -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMA

Re: get a column out of a 2d array

2007-10-03 Thread Chas. Owens
On 10/3/07, Mahurshi Akilla <[EMAIL PROTECTED]> wrote: > is there an easy way (without iterating through the array) to get a > specified column out of a 2d array? snip You need a loop of some form. The map function works well here (this is the sort of thing it was made for), but a for loop with s

Re: get a column out of a 2d array

2007-10-03 Thread Tom Phoenix
On 10/3/07, Mahurshi Akilla <[EMAIL PROTECTED]> wrote: > is there an easy way (without iterating through the array) to get a > specified column out of a 2d array? There is no way in general, easy or hard, to get a column out of an array in Perl without using iteration, even if the iteration is hi

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-28 Thread salva
Chas Owens wrote: > Be careful, this is Net::SFTP::Foreign, not Net::SFTP. > They are very similar, but there are differences. Well, I should know, as I am the module author ;-) > For instance the ls method > returns an arrayref, not a list in Net::SFTP::Foreign. This means > your code should

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-27 Thread Stephen Kratzer
On Friday 24 August 2007 21:00:37 John W. Krahn wrote: > Stephen Kratzer wrote: > > On Friday 24 August 2007 08:57:26 Marian Bednar wrote: > >> I am a newbie in this forum and Perl too ;-) > >> > >> I am trying writing script transfering files using module > >> Net::SFTP::Foreign. > >> > >> I need

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-27 Thread Chas Owens
On 8/27/07, salva <[EMAIL PROTECTED]> wrote: > On Aug 24, 2:57 pm, [EMAIL PROTECTED] (Marian Bednar) wrote: > > Hi all, > > > > I am a newbie in this forum and Perl too ;-) > > > > I am trying writing script transfering files using module > > Net::SFTP::Foreign. > > > > I need to retrieve from remo

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-27 Thread salva
On Aug 24, 2:57 pm, [EMAIL PROTECTED] (Marian Bednar) wrote: > Hi all, > > I am a newbie in this forum and Perl too ;-) > > I am trying writing script transfering files using module > Net::SFTP::Foreign. > > I need to retrieve from remote directory only names of files (not > directories, links,etc.

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-24 Thread John W. Krahn
Stephen Kratzer wrote: On Friday 24 August 2007 08:57:26 Marian Bednar wrote: I am a newbie in this forum and Perl too ;-) I am trying writing script transfering files using module Net::SFTP::Foreign. I need to retrieve from remote directory only names of files (not directories, links,etc.).

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-24 Thread Chas Owens
On 8/24/07, Marian Bednar <[EMAIL PROTECTED]> wrote: snip > print "$_->{filename} \n" if -f $_->{filename}; snip > Script above write out nothing, but if last line is this > > print "$_->{filename} \n"; > > It writes out names of files, directories, but I need only names of files. > How can I get i

Re: Get names of files ONLY using module Net::SFTP::Foreign

2007-08-24 Thread Stephen Kratzer
On Friday 24 August 2007 08:57:26 Marian Bednar wrote: > Hi all, > > > I am a newbie in this forum and Perl too ;-) > > I am trying writing script transfering files using module > Net::SFTP::Foreign. > > I need to retrieve from remote directory only names of files (not > directories, links,etc.). >

Re: get all services in windows?

2007-07-07 Thread Enjoy_Life
2007/7/6, Rob Dixon <[EMAIL PROTECTED]>: Enjoy_Life wrote: > > i want to get all the services installed by windows on my computer. > i found Win32::Service module, > but i don't know how to use it. > anyone can help me? use strict; use warnings; use Win32::Service qw(GetServices); my %servic

Re: get all services in windows?

2007-07-06 Thread Rob Dixon
Enjoy_Life wrote: i want to get all the services installed by windows on my computer. i found Win32::Service module, but i don't know how to use it. anyone can help me? use strict; use warnings; use Win32::Service qw(GetServices); my %service; GetServices('', \%service); printf "%s - %s\n

Re: Get summery of a jpeg file

2007-01-17 Thread Lawrence Statton XE2/N1GAK
tl.sa.earthlink.net with asmtp (Exim 4.34) > id 1H74wA-00041u-ME > for beginners@perl.org; Wed, 17 Jan 2007 02:10:23 -0500 > Message-ID: <[EMAIL PROTECTED]> > Date: Wed, 17 Jan 2007 01:05:08 -0600 > From: "Mumia W." <[EMAIL PROTECTED]> > User-Agent

Re: Get summery of a jpeg file

2007-01-16 Thread Mumia W.
On 01/16/2007 10:18 PM, Lawrence Statton XE2/N1GAK wrote: Omega 1911 wrote in part: Did YOU assume that the OP knew about CPAN. I know when I had my first interest in Perl, I had NO IDEA of who or what CPAN was, let alone that it existed Since the OPs question included, "Is there a cpan mo

Re: Get summery of a jpeg file

2007-01-16 Thread Lawrence Statton XE2/N1GAK
Omega 1911 wrote in part: >Did YOU assume that the OP knew about CPAN. I know when I had my first >interest in Perl, I had NO IDEA of who or what CPAN was, let alone that it >existed Since the OPs question included, "Is there a cpan module that can do this?" I think it is not unfair to assume

Re: Get summery of a jpeg file

2007-01-16 Thread Omega -1911
Before you asked us, you CERTAINLY did a search of CPAN for JPEG and Info, right? How did Image::MetaData::JPEG fail to meet your needs? It's huge, it's complicated, and the documentation is hard to read, but Image Magick (which comes with perl bindings) can do anything with an image that can

Re: Get summery of a jpeg file

2007-01-16 Thread Ovid
--- "Gallagher, Tim F (NE)" <[EMAIL PROTECTED]> wrote: > A friend asked me to write a program for a WIN32 OS. When this > person's > camera takes a picture it populates the file summery with information > (right click on the file, go to the summary tab). One field that I > need > to get is cal

Re: Get summery of a jpeg file

2007-01-16 Thread Lawrence Statton XE2/N1GAK
> > A friend asked me to write a program for a WIN32 OS. When this person's > camera takes a picture it populates the file summery with information > (right click on the file, go to the summary tab). One field that I need > to get is called "Date Picture Taken". I then need to rename the > pic

Re: get mysql data by column name

2006-10-16 Thread Rob Dixon
Dan wrote: Hi everybody I've been using DBI for a while now, having made some large programs utilising a mysql db, and all have been successful. But I've come across one project now that may be a little more taxing on my knowledge of DBI. All the while I've been using DBI, I've been getting da

Re: get week numeration in a year?

2006-09-01 Thread John W. Krahn
Practical Perl wrote: > Hello,list, Hello, > Is there a fast way to get the week numeration in a year? > For example,now it's 35th week in 2006,next week is 36th week of this > year then. $ perl -MPOSIX -le'print strftime q/%W/, localtime' 35 John -- use Perl; program fulfillment -- To unsu

RE: get week numeration in a year?

2006-09-01 Thread Wijaya Edward
Hi Look for a CPAN module called Date::Calc. There you can find a method called Week_of_Year. Hope that's what you want. Regards, -- Edward WIJAYA SINGAPORE From: Practical Perl [mailto:[EMAIL PROTECTED] Sent: Fri 9/1/2006 3:34 PM To: beginners perl Subje

Re: get only filenames and not directory names under a specific path.

2006-07-27 Thread Alan_C
On Wednesday 26 July 2006 00:59, Rob Dixon wrote: > Hello Alan > > Alan_C wrote: > > On Tuesday 25 July 2006 15:56, Rob Dixon wrote: > >>Nishi Bhonsle wrote: [ snip ] > > [ snip ] [ snip ] > > #!/usr/bin/perl > >use strict; > >use warnings; > > > >my @dir = do { > > # opend

Re: get only filenames and not directory names under a specific path.

2006-07-26 Thread Rob Dixon
Hello Alan Alan_C wrote: > > On Tuesday 25 July 2006 15:56, Rob Dixon wrote: > >>Nishi Bhonsle wrote: >> >> > I got the last soln, ie to use File::Basename module. Please ignore the >> > last thread. >> > >> > I am still interested to know why Rob's soln doesnt work for me? >> >>So was I, and it'

Re: get only filenames and not directory names under a specific path.

2006-07-25 Thread Alan_C
On Tuesday 25 July 2006 15:56, Rob Dixon wrote: > Nishi Bhonsle wrote: > > I got the last soln, ie to use File::Basename module. Please ignore the > > last thread. > > > > I am still interested to know why Rob's soln doesnt work for me? > > So was I, and it's because I made a mistake. Because t

Re: get only filenames and not directory names under a specific path.

2006-07-25 Thread Dr.Ruud
"Nishi Bhonsle" schreef: [don't! top-post!] > [IO:All] > Currently, it prints > C:\..\..\..\File1.txt > etc > I really want it only print File1.txt I don't understand how you read the documentation. Just search for 'filename'. And start to grok the 'All' in IO::All. -- Affijn, Ruud "Gewoon i

Re: get only filenames and not directory names under a specific path.

2006-07-25 Thread Rob Dixon
Nishi Bhonsle wrote: > > I got the last soln, ie to use File::Basename module. Please ignore the > last thread. > > I am still interested to know why Rob's soln doesnt work for me? So was I, and it's because I made a mistake. Because the values returned by readdir don't include a full path, the

  1   2   3   >