>
> as opposed to what i would have normally done ($aggregated_file_contents
> .= $data;)
>
> yes, i know i can simply try it, to see if it works - but is there a more
> general rule one can follow that tells them when this kind of thing can
> normally be used, versus when not?
&g
Greg --
When you're looking for something in particular, it's easy to just look for
that specific thing. As you say, Perl has different definitions of what
"\n" actually translates to depending on platform and context. So rather
than worry about "\n" just have Perl look for what you're actually lo
Greg --
The pipe | operator isn't single characters only:
$string =~ /this|that|the other/;
But the character set is:
$string =~ /[abc]/; # matches any a, b or c
$string =~ /[tw]hat/; # matches 'that' or 'what'
What you're looking for is something like this:
$string =~ /\\L(ength)?\b/;
That'
On Tue, Nov 8, 2011 at 11:20 AM, Paul Rousseau
wrote:
> Here is the Dumper output when I use the code,
>
> push @{$project{$projectno}}, \%days;
>
Right, so $project{$projectno} is an ARRAYREF, and each entry pushed in
this way will be a HASHREF.
Note that other entries may exist in your array b
On Fri, Nov 4, 2011 at 1:15 PM, wrote:
> Perl should handle the \r\n part for you - "\n" is normally a match for
> whatever your OS's end of line marker is.
>
But just in case you're on *nix and processing a Windo~1 file, split(
/[\r\n]+/, $msg ) is reasonably bullet-proof for breaking a string
How about something like this:
next unless m:(\d\d\d\d)/(\d\d)/(\d\d):;
$start_date = "$1$2$3";
On Wed, Nov 2, 2011 at 4:07 PM, Paul Rousseau
wrote:
> Hello Perl folks,
>
>
> I would like to know if there is an eloquent way of extracting a date
> string from a file.
>
> My code goes like t
I haven't tested this, but here's a similar problem to yours--maybe these
solutions will work for you:
http://www.perlmonks.org/?node_id=4913
On Tue, Jul 5, 2011 at 3:43 PM, Barry Brevik wrote:
> I am writing an app that has a lot of screen output which it writes to
> STDERR.
>
> The screen out
Or if you want the characters themselves:
@result = map { chr( hex ) } @source;
Or as a solid string:
$s = join '', map { chr( hex ) } @source;
On Tue, Nov 23, 2010 at 3:47 PM, will trillich
wrote:
> Dude! This one is really easy:
>
> print hex("ff"); # 2
Dude! This one is really easy:
print hex("ff"); # 255!
so @result = map{ hex } @source;
Mwa ha ha!
On Tue, Nov 23, 2010 at 3:44 PM, Greg Aiken wrote:
> if one dumps a windows registry section using regedit (to *.reg format)
>
>
>
> the reg_sz values are listed in the following format (heres
Here's my take:
print 'it\'s time \\ to go';
The backslash can quote the single-quote, and hence another backslash as
well for completeness, within a single-quoted string.
On Wed, Oct 20, 2010 at 12:09 PM, Greg Aiken wrote:
> forgive my ignorance here, but I thought single quoted, or apostro
10 matches
Mail list logo