Tech list asked:
> Let's say I have a module XYZ with a sub in it call ABC. I'd like to
> print the source code of XYZ::ABC.
>
> My reason for this is I accidentally overwrote a module with an older
> version, but I still have httpd running which has it loaded in memory.
You can't print the "so
HACKER Nora wrote:
> Obviously, my point wasn't clear enough, I'm sorry for that. The
> variable in the code extract that I'm really bothering about is the
> $sdb: It is needed in the SWITCH of a sub-function, but this construct
> only works if I pre-declare the $sdb in the calling function backup
Hi Shlomi,
Thanks for your reply.
> From a cursory look at your program, it seems that you can just set up
> $mode
> as a global variable, and keep it at that instead of just passing it
> around.
> Alternatively, maybe you'd like to define a class and keep the mode
> variable
> there as a propert
On Thursday 20 May 2010, Shawn H Corey wrote:
> #!/usr/bin/perl
>
> use strict;
> use warnings;
>
> use Data::Dumper;
>
> # Make Data::Dumper pretty
> $Data::Dumper::Sortkeys = 1;
> $Data::Dumper::Indent = 1;
>
> # Set maximum depth for Data::Dumper, zero means unlimited
> local $Data::Dumpe
>> "BRH" == Bryan R Harris writes:
>
> BRH> I have code that looks like this:
>
> BRH> **
> BRH> if ($props =~ /\S/) {
> BRH> %{$ptr[-1]->[-1]} = ($props =~ m/\s*([^=]+)="([^"]+)"/g);
>
> where is @ptr set? what are you using it for?
Earlier
On 10-05-20 03:52 PM, Uri Guttman wrote:
i didn't say it was for output but for debugging. and i didn't say YOU
shouldn't do it. i wrote for others to learn when to and not to use
Dumper. it isn't always the best choice. you can use it all the
time. they don't need to. simpler print/map is fine f
Let's say I have a module XYZ with a sub in it call ABC. I'd like to
print the source code of XYZ::ABC.
My reason for this is I accidentally overwrote a module with an older
version, but I still have httpd running which has it loaded in memory.
--
To unsubscribe, e-mail: beginners-unsubscr
> "BRH" == Bryan R Harris writes:
BRH> I have code that looks like this:
BRH> **
BRH> if ($props =~ /\S/) {
BRH> %{$ptr[-1]->[-1]} = ($props =~ m/\s*([^=]+)="([^"]+)"/g);
where is @ptr set? what are you using it for?
BRH> }
BRH> My proble
I have code that looks like this:
**
if ($props =~ /\S/) {
%{$ptr[-1]->[-1]} = ($props =~ m/\s*([^=]+)="([^"]+)"/g);
}
**
My problem is that I only want to append the properties and their values to
that hash, not replac
> "SHC" == Shawn H Corey writes:
SHC> On 10-05-20 03:17 PM, Uri Guttman wrote:
>>> "SHC" == Shawn H Corey writes:
>>
SHC> On 10-05-20 02:07 PM, Uri Guttman wrote:
>> >> not a major point, but why do you use dumper just to print a list of
>> >> tokens? i use dumper for deep
On Thursday 20 May 2010 13:52:58 HACKER Nora wrote:
> Hello,
>
> I have a programme for database backup / recovery / some other tasks
> with several modes (e.g. ackup etc.) in wich a certain function is
> called. In this function I do a SWITCH, depending on the mode that the
> main programme is st
On 10-05-20 03:17 PM, Uri Guttman wrote:
"SHC" == Shawn H Corey writes:
SHC> On 10-05-20 02:07 PM, Uri Guttman wrote:
>> not a major point, but why do you use dumper just to print a list of
>> tokens? i use dumper for deeper stuff where i can't just print the data
>> easily wit
> "SHC" == Shawn H Corey writes:
SHC> On 10-05-20 02:07 PM, Uri Guttman wrote:
>> not a major point, but why do you use dumper just to print a list of
>> tokens? i use dumper for deeper stuff where i can't just print the data
>> easily without some code. even single level hashes i wil
On 10-05-20 02:07 PM, Uri Guttman wrote:
not a major point, but why do you use dumper just to print a list of
tokens? i use dumper for deeper stuff where i can't just print the data
easily without some code. even single level hashes i will print directly
as i can format it my way and not dumper's
> "SHC" == Shawn H Corey writes:
SHC> my @data = qw( The quick brown fox jumped over the lazy dogs. );
SHC> my $regx = qr{ [aeiou] }msx;
SHC> my @matches = map { /($regx)/ } @data;
SHC> print '@matches : ', Dumper \...@matches;
not a major point, but why do you use dumper just to pri
On 10-05-20 12:52 PM, Akhthar Parvez K wrote:
Hi all,
Can Perl regex match a string in a list (like Perl grep)?
eg:-
#won't work
$_ = @data;
my @matches = /($regx)/g;
#works, but not as quite really wanted since it would show the line contains
the string, not just the matched string:
my @matche
Hi all,
Can Perl regex match a string in a list (like Perl grep)?
eg:-
#won't work
$_ = @data;
my @matches = /($regx)/g;
#works, but not as quite really wanted since it would show the line contains
the string, not just the matched string:
my @matches = grep /($regx)/, @data;
So, can Perl grep s
On Fri, May 14, 2010 at 12:21:21PM -0400, Jay Savage wrote:
> >
> > CODE
> > #!/usr/bin/perl
> > use YAML::Syck;
> > use Data::Dumper;
> >
> > my ($yaml) = Load(<<'...');
> > ---
> > nameserver:
> > - 172.23.0.5
> > - 172.23.0.6
> > randomvar:
> > - ela
Hello,
I have a programme for database backup / recovery / some other tasks
with several modes (e.g. ackup etc.) in wich a certain function is
called. In this function I do a SWITCH, depending on the mode that the
main programme is started with. In one of the cases of SWITCH (e.g.
ecovery) I use a
19 matches
Mail list logo