Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Jeff Peng
于 2012-2-9 15:21, Parag Kalra 写道: By data-structures being used, I mean the data structures that are actually *declared* in the script. And is it possible to find at least the data-structures stats of the current script that is getting executed if no parser is available. For example if I hav

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Parag Kalra
By data-structures being used, I mean the data structures that are actually *declared* in the script. And is it possible to find at least the data-structures stats of the current script that is getting executed if no parser is available. For example if I have a big script or module and if I want

Re: unexpected results

2012-02-08 Thread lina
On Thu, Feb 9, 2012 at 2:31 PM, Jeff Peng wrote: > 于 2012-2-9 14:10, lina 写道: > >> On Thu, Feb 9, 2012 at 1:44 PM, Jeff Peng wrote: >>> >>> > 于 2012-2-9 12:44, lina 写道: >>> > >> $string =~ m/(\S+)(and|or)(\S+)/; >>> >>> > >>> > >>> > $string =~ m/(\S+)\s+(and|or)\s+(\S+)/; >> >> Wow,

Re: unexpected results

2012-02-08 Thread Jeff Peng
于 2012-2-9 14:10, lina 写道: On Thu, Feb 9, 2012 at 1:44 PM, Jeff Peng wrote: > 于 2012-2-9 12:44, lina 写道: > >> $string =~ m/(\S+)(and|or)(\S+)/; > > > $string =~ m/(\S+)\s+(and|or)\s+(\S+)/; Wow, thanks how does that one not work as expected, I am reading brian d foy "Mastering Perl", ht

Re: unexpected results

2012-02-08 Thread lina
On Thu, Feb 9, 2012 at 1:44 PM, Jeff Peng wrote: > 于 2012-2-9 12:44, lina 写道: > >> $string =~ m/(\S+)(and|or)(\S+)/; > > > $string =~ m/(\S+)\s+(and|or)\s+(\S+)/; Wow, thanks how does that one not work as expected, I am reading brian d foy "Mastering Perl", http://www.amazon.com/Mastering-Perl-

Re: unexpected results

2012-02-08 Thread Steve Bertrand
On 2012.02.08 23:44, lina wrote: my @strings = ( "Fred and Barney", "Gilligan or Skipper", "Fred and Ginger" ); ...brings back memories of a book that Randal authored a few years ago, which made Perl references 'click' for me. (poor Gilligan, he d

Re: unexpected results

2012-02-08 Thread Jeff Peng
于 2012-2-9 12:44, lina 写道: $string =~ m/(\S+)(and|or)(\S+)/; $string =~ m/(\S+)\s+(and|or)\s+(\S+)/; HTH. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/

unexpected results

2012-02-08 Thread lina
#!/usr/bin/perl use strict ; my @strings = ( "Fred and Barney", "Gilligan or Skipper", "Fred and Ginger" ); foreach my $string (@strings) { $string =~ m/(\S+)(and|or)(\S+)/; print "\$1: $1\n\$2: $2\n\$3: $3\n"; print

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Jeff Peng
于 2012-2-9 10:15, Steve Bertrand 写道: I would suspect that this would be something that would have to run against the file itself, even prior to compile. Curious task. Might I ask what the purpose of your desire is? I am also not sure what's the special purpuse of the OP. Some modules on CP

Re: Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Steve Bertrand
On 2012.02.08 17:20, Parag Kalra wrote: Do we have any Perl module which can parse any other perl script (or module) and fetch information like total number of arrays being used, total number of hashes, total number of scalar variables etc and size information (like total elements, total keys e

Perl Module to parse any other Perl script/module to fetch stats about data-structures

2012-02-08 Thread Parag Kalra
Do we have any Perl module which can parse any other perl script (or module) and fetch information like total number of arrays being used, total number of hashes, total number of scalar variables etc and size information (like total elements, total keys etc) for each data structure in that perl sc

Re: Editing line of text.

2012-02-08 Thread Sean Murphy
Hi, I have tried to install Term::REadLine::Gnu. Get the below errors when it is being make. Can CPan install libreadline-dev library? Running install for module 'Term::ReadLine::Gnu' Running make for H/HA/HAYASHI/Term-ReadLine-Gnu-1.20.tar.gz CPAN: Digest::SHA loaded ok (v5.47) CPAN: Compress::

Re: Editing line of text.

2012-02-08 Thread Shlomi Fish
Hi Igor, thanks for helping Sean and shedding light on the problem he had with my code. Regards, Shlomi Fish On Wed, 8 Feb 2012 15:02:49 +0200 Igor Dovgiy wrote: > Hi Sean, > > Let's follow the documentation, shall we? ) > > -- readline(PROMPT[,PREPUT]) > Gets an input line, with ac

Re: Editing line of text.

2012-02-08 Thread Igor Dovgiy
Hi Sean, Let's follow the documentation, shall we? ) -- readline(PROMPT[,PREPUT]) Gets an input line, with actual GNU Readline support. Trailing newline is removed. Returns undef on EOF. PREPUT is an optional argument meaning the initial value of input. The optional argument PREPUT is granted onl

Re: Editing line of text.

2012-02-08 Thread Sean Murphy
Hi Shlomi I used your example code and the 'hello' did not appear on the input field. The '$' did as the prompt. So I couldn't edit the 'hello'. I had to enter it in. Below is the example output: Output: $ You've given 'hello' $ What I wanted was: $Hello You've given 'hell' $ As you can te

Re: Editing line of text.

2012-02-08 Thread Shlomi Fish
Hi Sean, On Wed, 8 Feb 2012 18:37:37 +1100 Sean Murphy wrote: > Hi All. > > This should be a simple task. But for the life of me, I cannot work it out. > I have a chunk of text in an scaler. I want to edit this text. I look at > Term::ReadLine and couldn't see a way of inserting the text into