Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread Jim Gibson
On Jan 10, 2013, at 7:33 PM, budi pearl wrote: > Hi All, > > I would like to pass hash: %{$routes{"ROUTE-252"}} instead of %routes but > got this error: > > [budi@dev bin]$ ./print_path.pl > Type of arg 1 to each must be hash (not hash element) at > ./print_path.plline 38, near "}) " > Executio

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
On Fri, Jan 11, 2013 at 11:05 AM, budi pearl wrote: > Hi Shawn, > > When trying to accessed inside subroutine , i got: > > Type of arg 1 to each must be hash (not hash element) at ./print_path.plline > 41, near "}) " > > Execution of ./print_path.pl aborted due to compilation errors. > > > this

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
Hi Shawn, When trying to accessed inside subroutine , i got: Type of arg 1 to each must be hash (not hash element) at ./print_path.plline 41, near "}) " Execution of ./print_path.pl aborted due to compilation errors. this is work: while (my ($start, $end) = each %{$routes{$label}}) { but thi

Re: Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread Shawn H Corey
On Fri, 11 Jan 2013 10:33:02 +0700 budi pearl wrote: > my $id = "ROUTE-252"; > print Dumper $routes{$id}; > > print_path($id, \%{$routes{$id}}); I think you want: print_path( $id, $routes{$id} ); -- Don't stop where the ink does. Shawn -- To unsubscribe, e-mail: beginners-unsubs

Passing hash ref [ was Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
Hi All, I would like to pass hash: %{$routes{"ROUTE-252"}} instead of %routes but got this error: [budi@dev bin]$ ./print_path.pl Type of arg 1 to each must be hash (not hash element) at ./print_path.plline 38, near "}) " Execution of ./print_path.pl aborted due to compilation errors. #use

Re: Hi

2013-01-10 Thread Shawn H Corey
On Fri, 11 Jan 2013 09:46:20 +0800 Feng He wrote: > 于 2013-1-11 7:57, Shawn H Corey 写道: > > On Thu, 10 Jan 2013 18:36:07 -0500 > > "Lou Pereira" wrote: > > > >> I beg to differ regarding your comment. I have been trying to be > >> removed from this list for over a year to no avail. So, all > >

Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
Hi Rob, This works and looks much more simpler. Thanks, i love it. --budhi On Fri, Jan 11, 2013 at 1:00 AM, Rob Dixon wrote: > On 10/01/2013 10:01, budi perl wrote: > >> Hi, >> >> I have this following hash: >> >> #!/usr/bin/perl >> # >> use strict; >> use Data::Dumper; >> >> my %MYROUTES = (

Re: Hi

2013-01-10 Thread Feng He
于 2013-1-11 7:57, Shawn H Corey 写道: On Thu, 10 Jan 2013 18:36:07 -0500 "Lou Pereira" wrote: I beg to differ regarding your comment. I have been trying to be removed from this list for over a year to no avail. So, all knowledge one, how do we remove ourselves from this mail list? Send a ema

Fwd: Hi

2013-01-10 Thread Andy Bach
Send a email to: beginners-unsubscr...@perl.org You will get a confirmation reply. Press "Reply" and "Send". You will get a final message saying good-bye. Sometimes the address can be tricky - the FAQ http://learn.perl.org/faq/beginners.html says: Send mail to , and wait for a response. Once you

Re: Hi

2013-01-10 Thread Shawn H Corey
On Thu, 10 Jan 2013 18:36:07 -0500 "Lou Pereira" wrote: > I beg to differ regarding your comment. I have been trying to be > removed from this list for over a year to no avail. So, all > knowledge one, how do we remove ourselves from this mail list? Send a email to: beginners-unsubscr...@perl.

Re: Hi

2013-01-10 Thread Kristin Nielsen
Lou - Klamerus' frustration is not completely unwarranted. I answered that question in my reply to the list - did you read it? If not, there are three steps to take - fewer if you are successful. 1. Start an email from the account with which you subscribed to the list. You MUST send your unsub

Re: check processes accessing file system

2013-01-10 Thread Paul.G
thanks From: David Precious To: beginners@perl.org Sent: Friday, 11 January 2013 12:07 AM Subject: Re: check processes accessing file system On Thu, 10 Jan 2013 05:01:38 -0800 (PST) "Paul.G" wrote: > Linux/Unix you would use. > > eg: > fuser -c /tmp > or

RE: Hi

2013-01-10 Thread Lou Pereira
I beg to differ regarding your comment. I have been trying to be removed from this list for over a year to no avail. So, all knowledge one, how do we remove ourselves from this mail list? -Original Message- From: klamerus [mailto:klame...@earthlink.net] Sent: Thursday, January 10, 201

RE: Hi

2013-01-10 Thread klamerus
Since you clearly don't know how mailing lists work I'm afraid that's not possible. -Original Message- From: bhanu chaitanya abbaraju [mailto:bhanu.cha...@gmail.com] Sent: Thursday, January 10, 2013 2:04 PM To: beginners@perl.org Subject: Hi Please help me how can I stop perl emails --

Re: Hi

2013-01-10 Thread David Precious
On Fri, 11 Jan 2013 00:34:14 +0530 bhanu chaitanya abbaraju wrote: > Please help me how can I stop perl emails "stop perl emails"? Taking a guess that you mean you want to unsubscribe from this mailing list, each post from the list contains the following header: List-Unsubscribe:

Hi

2013-01-10 Thread bhanu chaitanya abbaraju
Please help me how can I stop perl emails -- A.Bhanuchaitanya

Re: finding head and tail in data structure

2013-01-10 Thread Rob Dixon
On 10/01/2013 10:01, budi perl wrote: Hi, I have this following hash: #!/usr/bin/perl # use strict; use Data::Dumper; my %MYROUTES = ( "ROUTE-252" => { # src => dest 427 => "ABEP", "ABEP" => 441, 441 => 427, 427 => 444, 444 => "MGWQ",

Re: finding head and tail in data structure

2013-01-10 Thread budi pearl
On Thu, Jan 10, 2013 at 5:19 PM, David Precious wrote: > On Thu, 10 Jan 2013 17:01:43 +0700 > budi perl wrote: > You can't have the same hash key twice; you've duplicated 427 there. > > Also, you don't need to quote the left side of a fat comma, so you can > just as easily say e.g. ABEP => 441. >

Re: File:: Find help

2013-01-10 Thread punit jain
I think the issue is as you mentioned exporting find from File::Find::Rule. However File::Find I am not sure I will get that flexibility to search only 1 level depth. On Thu, Jan 10, 2013 at 6:07 PM, David Precious wrote: > On Thu, 10 Jan 2013 17:56:18 +0530 > punit jain wrote: > > > I need to

Re: check processes accessing file system

2013-01-10 Thread David Precious
On Thu, 10 Jan 2013 05:01:38 -0800 (PST) "Paul.G" wrote: > Linux/Unix you would use. > > eg: > fuser -c /tmp > or > lsof could also be used. > > > I was wondering if there was a perl module that does the same thing. See Unix::Lsof then, as per my reply - it should do what you need. -- To u

Re: File:: Find help

2013-01-10 Thread John W. Krahn
punit jain wrote: Hi, Hello, I have a requirement where I have directory structure like : - test --> test/user1/files/, test/user2/files/, test/user3/files/ etc. under sub-directories with usernames I have file with name usersettings. So the final structure as : - test / user1 / usersett

Re: check processes accessing file system

2013-01-10 Thread Paul.G
Linux/Unix you would use. eg: fuser -c /tmp or lsof could also be used. I was wondering if there was a perl module that does the same thing. From: David Precious To: beginners@perl.org Cc: Paul.G Sent: Thursday, 10 January 2013 8:22 PM Subject: Re: check

Re: File:: Find help

2013-01-10 Thread David Precious
On Thu, 10 Jan 2013 17:56:18 +0530 punit jain wrote: > I need to get all the subdirectories of test and then read the file > usersettings under that later on to do some processing. I wrote code > below :- > #!/usr/bin/perl > use strict; > use warnings; > use File::Basename qw(basename dirname); >

File:: Find help

2013-01-10 Thread punit jain
Hi, I have a requirement where I have directory structure like : - test --> test/user1/files/, test/user2/files/, test/user3/files/ etc. under sub-directories with usernames I have file with name usersettings. So the final structure as : - test / user1 / usersettings /files/

File::Find help

2013-01-10 Thread punit jain
Hi, I have a requirement where I have directory structure like : - test --> test/user1/files, test/user2/files, test/user3/files etc. under sub-directories with usernames I have file with name usersettings. So the final structure as : - test / user1 / usersettings user2 / usersettings

Re: Mojolicious as replacement for cgi?

2013-01-10 Thread Manolis Tzanidakis
On Thu (10/01/13), kavita kulkarni wrote: > Hello, > Is there any simple documentation/book/link besides mojo-lite/CPAN online > documentation that will help me to understand the OO Perl programming and > web based perl programming? > > I am naive in Perl & OO progamming and have to get quickly st

Re: check processes accessing file system

2013-01-10 Thread Shlomi Fish
Hi Paul, On Wed, 9 Jan 2013 17:45:51 -0800 (PST) "Paul.G" wrote: > Hi > > Is there a quck way to test if processes are accessing file system in perl? > If you are using Linux you can use: * https://metacpan.org/search?q=inotify I think the *BSDs have some similar mechanisms, but I don't rem

Re: Mojolicious as replacement for cgi?

2013-01-10 Thread Shlomi Fish
Hi Kavita, On Thu, 10 Jan 2013 13:26:15 +0530 kavita kulkarni wrote: > Hello, > Is there any simple documentation/book/link besides mojo-lite/CPAN online > documentation that will help me to understand the OO Perl programming and > web based perl programming? > > I am naive in Perl & OO progamm

Re: check processes accessing file system

2013-01-10 Thread David Precious
On Wed, 9 Jan 2013 17:45:51 -0800 (PST) "Paul.G" wrote: > Is there a quck way to test if processes are accessing file system in > perl? That's quite a vague requirement. Find out what processes have a specific file open? Find out what processes are doing IO at that specific moment? What is it

Re: finding head and tail in data structure

2013-01-10 Thread David Precious
On Thu, 10 Jan 2013 17:01:43 +0700 budi perl wrote: > Hi, > > I have this following hash: > > #!/usr/bin/perl > # > use strict; > use Data::Dumper; > > my %MYROUTES = ( > "ROUTE-252" => { > # src => dest >427 => "ABEP", >"ABEP" => 441, >441 => 427, >427

finding head and tail in data structure

2013-01-10 Thread budi perl
Hi, I have this following hash: #!/usr/bin/perl # use strict; use Data::Dumper; my %MYROUTES = ( "ROUTE-252" => { # src => dest 427 => "ABEP", "ABEP" => 441, 441 => 427, 427 => 444, 444 => "MGWQ", "MGWQ" => "CDEF" }, "ROUTE-432" => {