[31284] in Perl-Users-Digest

home help back first fref pref prev next nref lref last post

Perl-Users Digest, Issue: 2529 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jul 31 16:04:13 2009

Date: Fri, 31 Jul 2009 13:03:28 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)

Perl-Users Digest           Fri, 31 Jul 2009     Volume: 11 Number: 2529

Today's topics:
        "uri_escape_utf8" is not exported by the URI::Escape mo <janedunnie@gmail.com>
    Re: "uri_escape_utf8" is not exported by the URI::Escap <RedGrittyBrick@spamweary.invalid>
    Re: "uri_escape_utf8" is not exported by the URI::Escap <janedunnie@gmail.com>
    Re: "uri_escape_utf8" is not exported by the URI::Escap <darkon.tdo@gmail.com>
        "When you see him as Sardar, you'll forget Saif Ali Kha <asim.ssat@gmail.com>
        Account information leaked QoS@invalid.net
        Can I not use the -E switch in the perl debugger/interp <jl_post@hotmail.com>
    Re: Can I not use the -E switch in the perl debugger/in <Peter@PSDT.com>
    Re: Can I not use the -E switch in the perl debugger/in jl_post@hotmail.com
    Re: Can I not use the -E switch in the perl debugger/in <ben@morrow.me.uk>
    Re: Concatenating selective lines from a bunch of files sln@netherlands.com
    Re: Concatenating selective lines from a bunch of files <jurgenex@hotmail.com>
    Re: Concatenating selective lines from a bunch of files <cwilbur@chromatico.net>
        Concatenating selective lines from a bunch of files int <clearguy02@yahoo.com>
    Re: Concatenating selective lines from a bunch of files <clearguy02@yahoo.com>
    Re: Concatenating selective lines from a bunch of files <jimsgibson@gmail.com>
    Re: Concatenating selective lines from a bunch of files <ben@morrow.me.uk>
    Re: Concatenating selective lines from a bunch of files <bugbear@trim_papermule.co.uk_trim>
    Re: Concatenating selective lines from a bunch of files <m@rtij.nl.invlalid>
    Re: cpan keeps asking: "Is it OK to try to connect to t <brian.d.foy@gmail.com>
    Re: FAQ 5.28 How can I read in an entire file all at on <clauskick@hotmail.com>
    Re: FAQ 5.28 How can I read in an entire file all at on <uri@stemsystems.com>
    Re: FAQ 5.28 How can I read in an entire file all at on <brian.d.foy@gmail.com>
    Re: FAQ 6.23 How can I match strings with multibyte cha <brian.d.foy@gmail.com>
    Re: FAQ 6.23 How can I match strings with multibyte cha <O_TEXT@nospam.fr>
    Re: FAQ 6.23 How can I match strings with multibyte cha <brian.d.foy@gmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

----------------------------------------------------------------------

Date: Mon, 27 Jul 2009 08:12:24 -0700 (PDT)
From: "Jane D." <janedunnie@gmail.com>
Subject: "uri_escape_utf8" is not exported by the URI::Escape module
Message-Id: <0a73f5a1-a8b7-4c36-846b-5671bb7ef61d@w6g2000yqw.googlegroups.com>

Hi,

I have some code which I need to implement, from a third party, but
seem to be getting stuck with the following error:

"uri_escape_utf8" is not exported by the URI::Escape module

All the modules are installed, and the line which fails is as follows:

use URI::Escape qw(uri_escape_utf8);


The code which needs this is below:

# URI escape only the characters that should be escaped, according to
RFC 3986
sub escape
{
my ($self, $x) = @_;
return uri_escape_utf8($x, +kUriEscapeRegex);
}


Any assistance greatly appreciated.
Jane




------------------------------

Date: Mon, 27 Jul 2009 16:58:56 +0100
From: RedGrittyBrick <RedGrittyBrick@spamweary.invalid>
Subject: Re: "uri_escape_utf8" is not exported by the URI::Escape module
Message-Id: <4a6dcec2$0$2527$da0feed9@news.zen.co.uk>


Jane D. wrote:
> Hi,
> 
> I have some code which I need to implement, from a third party, but
> seem to be getting stuck with the following error:
> 
> "uri_escape_utf8" is not exported by the URI::Escape module
> 
> All the modules are installed, and the line which fails is as follows:
> 
> use URI::Escape qw(uri_escape_utf8);
> 
> 
> The code which needs this is below:
> 
> # URI escape only the characters that should be escaped, according to
> RFC 3986
> sub escape
> {
> my ($self, $x) = @_;
> return uri_escape_utf8($x, +kUriEscapeRegex);
> }
> 
> 
> Any assistance greatly appreciated.

That's the sort of error message I get on a machine with an *old* 
version of the URI::Escape module.

I'd check which version is installed and, if needed, install the latest 
version of URI::Escape using cpan, ppm or whatever package manager your 
Perl installation uses.

-- 
RGB


------------------------------

Date: Tue, 28 Jul 2009 14:06:07 -0700 (PDT)
From: "Jane D." <janedunnie@gmail.com>
Subject: Re: "uri_escape_utf8" is not exported by the URI::Escape module
Message-Id: <b83ce373-db47-4b2f-ad07-9776e080a290@18g2000yqa.googlegroups.com>

Thanks RGB ... I did upgrade to a more recent version of the Escape
module, and it worked fine.

Thanks again!


------------------------------

Date: Thu, 30 Jul 2009 09:45:11 -0400
From: "darkon" <darkon.tdo@gmail.com>
Subject: Re: "uri_escape_utf8" is not exported by the URI::Escape module
Message-Id: <2PmdnSnsqNV1PuzXnZ2dnUVZ_tOdnZ2d@supernews.com>


"Jane D." <janedunnie@gmail.com> wrote in message 
news:b83ce373-db47-4b2f-ad07-9776e080a290@18g2000yqa.googlegroups.com...
> Thanks RGB ... I did upgrade to a more recent version of the Escape
> module, and it worked fine.

I didn't even know Mr. Guttman was imprisoned, much less that he needed to 
escape.



------------------------------

Date: Thu, 30 Jul 2009 08:27:05 -0700 (PDT)
From: asim malik <asim.ssat@gmail.com>
Subject: "When you see him as Sardar, you'll forget Saif Ali Khan is Muslim" -  Kareena
Message-Id: <dd6fbcca-84b3-42ae-8ec8-e9f891795b22@a37g2000prf.googlegroups.com>

Kareena Kapoor wants to work with Imtiaz Ali again. "I need my acting
energies to be re-fuelled. I'd love to work with Imtiaz Ali again
after Jab We Met. Right now, he's soaked in Love Aaj Kal. And that's
just fine. That's my film too."for complete story visit : www.enf786.blogspot.com


------------------------------

Date: Fri, 31 Jul 2009 03:20:18 GMT
From: QoS@invalid.net
Subject: Account information leaked
Message-Id: <Sptcm.1987$MA3.842@nwrddc02.gnilink.net>



This may be redundant but it seemed authentic enough.

And since some of us may not be checking the email associated with cpan;
here is a message regarding account information on CPAN:

Dear CPAN author,
 
This email is being sent to inform you that all passwords on the popular
Perl Monks website were compromised.  Many CPAN authors have accounts
there and in some cases have used the same password for PAUSE.
 
If you have any reason to suspect that your PAUSE account password is no longer secure, please visit https://pause.cpan.org/ and change it.
 
If your PAUSE account is not affected, please disregard this message and
accept apologies for the unsolicited email.
 
Regards,
PAUSE Administrators






------------------------------

Date: Thu, 30 Jul 2009 08:29:02 -0700 (PDT)
From: "jl_post@hotmail.com" <jl_post@hotmail.com>
Subject: Can I not use the -E switch in the perl debugger/interpreter?
Message-Id: <b9f930fa-53fa-4878-90a2-d0342f7a14cd@j9g2000prh.googlegroups.com>

Hi,

   I often create perl one-liners with the "-we" switch.  I also quite
often pop into the perl debugger/interpreter (with "perl -wde 1") to
either test code or to run short pieces of code.

   Now that I'm using Perl 5.10, I will often replace the "-we" switch
with "-wE" to take advantage of 5.10's "say" feature.  For example,
with this one-liner:

   perl -wE "say  foreach 1 .. 3"

we see the following output:

1
2
3

which is just what we'd expect.  Thanks to the "-E" switch I can take
advantage of the "say" feature, which allows me to omit typing the
"\n" that print() would require me to do.

   (I know that I can use the "-l" (ell) switch to force print() to
print a newline, but it also has other side-effects (such as stripping
off newlines with the <> operator) that the "say" feature doesn't
have.)

   However, if I invoke the perl interpreter/debugger, like this:

   perl -wdE 1

and then type:

   say  foreach 1 .. 3

then I don't seem to get any output.  I find this strange because I
would think the "-E" switch would enable the "say" feature for me,
just like it did in the above one-liner.

   (Now, I CAN use the "say" feature with this line:

   use feature 'say'; say  foreach 1 .. 3

but the "say" feature only applies in the scope of that one line,
meaning that if I want to use "say" again, I have to re-include it as
a feature.

Of course, I can always rewrite that line as:

   local $\ = "\n"; print  foreach 1 .. 3

but like before, I have to retype 'local $\ = "\n";' every time I want
that feature.)

   So my question is:  Is it possible for me to use the "-E" switch in
the perl debugger/interpreter to automatically invoke the "say"
feature, or can that only be used with perl one-liners (that is,
scripts written entirely at the command line)?

   (For the record, I'm seeing this behavior on both Linux and
Strawberry Perl for Windows.)

   Thanks,

   -- Jean-Luc


------------------------------

Date: Fri, 31 Jul 2009 14:02:01 GMT
From: Peter Scott <Peter@PSDT.com>
Subject: Re: Can I not use the -E switch in the perl debugger/interpreter?
Message-Id: <tPCcm.49924$ZN.26028@newsfe23.iad>

On Thu, 30 Jul 2009 08:29:02 -0700, jl_post@hotmail.com wrote:
>    So my question is:  Is it possible for me to use the "-E" switch in
> the perl debugger/interpreter to automatically invoke the "say" feature,
> or can that only be used with perl one-liners (that is, scripts written
> entirely at the command line)?

The reason lies in toke.c: the debugger is loaded before -E is processed:

	    if (PL_perldb) {
		/* Generate a string of Perl code to load the debugger.
[...]
	    if (PL_minus_E)
		sv_catpvs(PL_linestr,
			  "use feature ':5." STRINGIFY(PERL_VERSION) "';");

So at the moment, the answer is no.  I'll ask P5P whether it has to stay 
this way.

-- 
Peter Scott
http://www.perlmedic.com/
http://www.perldebugged.com/
http://www.informit.com/store/product.aspx?isbn=0137001274


------------------------------

Date: Fri, 31 Jul 2009 07:29:59 -0700 (PDT)
From: jl_post@hotmail.com
Subject: Re: Can I not use the -E switch in the perl debugger/interpreter?
Message-Id: <312ad0e1-67cf-41d9-816f-44dd6250e3af@d36g2000prb.googlegroups.com>

> On Thu, 30 Jul 2009 08:29:02 -0700, jl_p...@hotmail.com wrote:
> >
> > =A0 =A0So my question is: =A0Is it possible for me to use the "-E" swit=
ch in
> > the perl debugger/interpreter to automatically invoke the "say" feature=
,
> > or can that only be used with perl one-liners (that is, scripts written
> > entirely at the command line)?

On Jul 31, 8:02 am, Peter Scott <Pe...@PSDT.com> replied:
>
> So at the moment, the answer is no. =A0I'll ask P5P whether it has to sta=
y
> this way.

   Thanks for letting me know, Peter.  I appreciate it.

   -- Jean-Luc


------------------------------

Date: Fri, 31 Jul 2009 19:17:34 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Can I not use the -E switch in the perl debugger/interpreter?
Message-Id: <u2pbk6-t7u2.ln1@osiris.mauzo.dyndns.org>


Quoth "jl_post@hotmail.com" <jl_post@hotmail.com>:
> 
>    However, if I invoke the perl interpreter/debugger, like this:
> 
>    perl -wdE 1
> 
> and then type:
> 
>    say  foreach 1 .. 3
> 
> then I don't seem to get any output.  I find this strange because I
> would think the "-E" switch would enable the "say" feature for me,
> just like it did in the above one-liner.

It seems that DB::eval doesn't run the code with the proper hints from
the calling scope. File a bug with perlbug.

Ben



------------------------------

Date: Sat, 25 Jul 2009 13:17:21 -0700
From: sln@netherlands.com
Subject: Re: Concatenating selective lines from a bunch of files into a single  file
Message-Id: <umpm65l4788nah2cu9f3vsvb2r6ieu2he2@4ax.com>

On Sat, 25 Jul 2009 09:10:08 -0700 (PDT), Rider <clearguy02@yahoo.com> wrote:

>Hi experts,
>
>I have a unix dir, test and it has 100 files. I need to extract all
>the lines that contain a word "keyword" key word" (case insensitive)
>from each of those files and put all those lines into another file,
>concatenate.txt. Similarly, I want all the lines that don't contain
>that key word (keyword or key word) into another file,
>non_concatenate.txt.
>
>I know a little bit of perl and I am wondering how can I do it here.
>
>Thanks,
>J

I am curious as to what end this de-interlace achieves?
There seems to be no pragmatic function to it.
Its fine if its just an exercise. Usually though, a real world
effort will reap more rewards to you personally.

Good luck!
-sln



------------------------------

Date: Sat, 25 Jul 2009 18:20:28 -0700
From: Jürgen Exner <jurgenex@hotmail.com>
Subject: Re: Concatenating selective lines from a bunch of files into a single  file
Message-Id: <ckbn651ekfttvsjcp59m8i869cs6qmtnfr@4ax.com>

Rider <clearguy02@yahoo.com> wrote:
>I have a unix dir, test and it has 100 files. 

opendir() and readdir() or glob().

>I need to extract all
>the lines that contain a word "keyword" key word" (case insensitive)
>from each of those files

loop through all those files who's names you gathered in step 1, 
open() each, read it line by line and depening upon if the line matches
(m//), then 

>and put all those lines into another file,
>concatenate.txt.

print() that line to the target file, which you open()ed earlier

> Similarly, I want all the lines that don't contain
>that key word (keyword or key word) into another file,
>non_concatenate.txt.

or the other target file, which you also open()ed earlier.

jue


------------------------------

Date: Sun, 26 Jul 2009 12:04:55 -0400
From: Charlton Wilbur <cwilbur@chromatico.net>
Subject: Re: Concatenating selective lines from a bunch of files into a single  file
Message-Id: <863a8jzazc.fsf@mithril.chromatico.net>

>>>>> "R" == Rider  <clearguy02@yahoo.com> writes:

    R> Hi experts, I have a unix dir, test and it has 100 files. I need
    R> to extract all the lines that contain a word "keyword" key word"
    R> (case insensitive) from each of those files and put all those
    R> lines into another file, concatenate.txt. Similarly, I want all
    R> the lines that don't contain that key word (keyword or key word)
    R> into another file, non_concatenate.txt.

    R> I know a little bit of perl and I am wondering how can I do it
    R> here.

The simplest thing would be to forgo Perl altogether and use the Unix
grep utility.

Charlton

    

-- 
Charlton Wilbur
cwilbur@chromatico.net


------------------------------

Date: Sat, 25 Jul 2009 09:10:08 -0700 (PDT)
From: Rider <clearguy02@yahoo.com>
Subject: Concatenating selective lines from a bunch of files into a single  file
Message-Id: <f0ed1184-fd0a-4ac3-b2d2-cd422b9ea5ea@p36g2000prn.googlegroups.com>

Hi experts,

I have a unix dir, test and it has 100 files. I need to extract all
the lines that contain a word "keyword" key word" (case insensitive)
from each of those files and put all those lines into another file,
concatenate.txt. Similarly, I want all the lines that don't contain
that key word (keyword or key word) into another file,
non_concatenate.txt.

I know a little bit of perl and I am wondering how can I do it here.

Thanks,
J


------------------------------

Date: Sat, 25 Jul 2009 09:28:55 -0700 (PDT)
From: Rider <clearguy02@yahoo.com>
Subject: Re: Concatenating selective lines from a bunch of files into a single  file
Message-Id: <4208ae06-3589-43ac-894b-8e3490e09606@2g2000prl.googlegroups.com>

On Jul 25, 9:10=A0am, Rider <cleargu...@yahoo.com> wrote:
> Hi experts,
>
> I have a unix dir, test and it has 100 files. I need to extract all
> the lines that contain a word "keyword" key word" (case insensitive)
> from each of those files and put all those lines into another file,
> concatenate.txt. Similarly, I want all the lines that don't contain
> that key word (keyword or key word) into another file,
> non_concatenate.txt.
>
> I know a little bit of perl and I am wondering how can I do it here.
>
> Thanks,
> J

What is the easiest way? To use File::Find module and then use grep,
join commands?

Thanks in advance,
J


------------------------------

Date: Sat, 25 Jul 2009 10:50:10 -0700
From: Jim Gibson <jimsgibson@gmail.com>
Subject: Re: Concatenating selective lines from a bunch of files into a single file
Message-Id: <250720091050104244%jimsgibson@gmail.com>

In article
<4208ae06-3589-43ac-894b-8e3490e09606@2g2000prl.googlegroups.com>,
Rider <clearguy02@yahoo.com> wrote:

> On Jul 25, 9:10 am, Rider <cleargu...@yahoo.com> wrote:
> > Hi experts,
> >
> > I have a unix dir, test and it has 100 files. I need to extract all
> > the lines that contain a word "keyword" key word" (case insensitive)
> > from each of those files and put all those lines into another file,
> > concatenate.txt. Similarly, I want all the lines that don't contain
> > that key word (keyword or key word) into another file,
> > non_concatenate.txt.
> >
> > I know a little bit of perl and I am wondering how can I do it here.
> >
> > Thanks,
> > J
> 
> What is the easiest way? To use File::Find module and then use grep,
> join commands?

The easiest way would be call your Perl program with all of the file
names on the command-line:
  
  program.pl /test/*

Then use the construct

  while(<>) {
    ...
  }

to read all of the lines in all of the files. Open two files before you
enter the while loop:

  open(my $yes, '>', 'concatenate.txt') or die(...);
  open(my $no, '>', 'non_concatenate.txt') or die(...);

Then in the body of the while loop, use the match operator with a
regular expression (case insensitive):

  if( /keyword/i ) {
    print $yes;
  }else{
    print $no;
  }

If your shell complains about the length of the command-line, you can
use opendir and readdir to fetch the file names in your directory, then
open each file for reading individually.

-- 
Jim Gibson


------------------------------

Date: Sat, 25 Jul 2009 19:18:58 +0100
From: Ben Morrow <ben@morrow.me.uk>
Subject: Re: Concatenating selective lines from a bunch of files into a single file
Message-Id: <iturj6-t58.ln1@osiris.mauzo.dyndns.org>


Quoth Jim Gibson <jimsgibson@gmail.com>:
> In article
> <4208ae06-3589-43ac-894b-8e3490e09606@2g2000prl.googlegroups.com>,
> Rider <clearguy02@yahoo.com> wrote:
> 
> > On Jul 25, 9:10 am, Rider <cleargu...@yahoo.com> wrote:
> > > Hi experts,
> > >
> > > I have a unix dir, test and it has 100 files. I need to extract all
> > > the lines that contain a word "keyword" key word" (case insensitive)
> > > from each of those files and put all those lines into another file,
> > > concatenate.txt. Similarly, I want all the lines that don't contain
> > > that key word (keyword or key word) into another file,
> > > non_concatenate.txt.
> > 
> > What is the easiest way? To use File::Find module and then use grep,
> > join commands?
> 
> The easiest way would be call your Perl program with all of the file
> names on the command-line:
>   
>   program.pl /test/*
> 
> Then use the construct
> 
>   while(<>) {
>     ...
>   }
> 
> to read all of the lines in all of the files. Open two files before you
> enter the while loop:
> 
>   open(my $yes, '>', 'concatenate.txt') or die(...);
>   open(my $no, '>', 'non_concatenate.txt') or die(...);
> 
> Then in the body of the while loop, use the match operator with a
> regular expression (case insensitive):
> 
>   if( /keyword/i ) {
>     print $yes;

Ow! Yes, I know it works, but it's *really* confusing. At least use
uppercase for your filehandles, if you're going to do that. I'd *much*
rather see

    print $YES $_;

explicitly.

> If your shell complains about the length of the command-line, you can
> use opendir and readdir to fetch the file names in your directory, then
> open each file for reading individually.

Simpler would be

    local @ARGV = glob "$dir/*";

    while (<>) {...}

Ben



------------------------------

Date: Mon, 27 Jul 2009 10:01:20 +0100
From: bugbear <bugbear@trim_papermule.co.uk_trim>
Subject: Re: Concatenating selective lines from a bunch of files into a single file
Message-Id: <8aadnUn9FYp08fDXnZ2dnUVZ8nxi4p2d@brightview.co.uk>

Martijn Lievaart wrote:
> On Sat, 25 Jul 2009 09:10:08 -0700, Rider wrote:
> 
>> Hi experts,
>>
>> I have a unix dir, test and it has 100 files. I need to extract all the
>> lines that contain a word "keyword" key word" (case insensitive) from
>> each of those files and put all those lines into another file,
>> concatenate.txt. Similarly, I want all the lines that don't contain that
>> key word (keyword or key word) into another file, non_concatenate.txt.
>>
>> I know a little bit of perl and I am wondering how can I do it here.
> 
> I would not do this in perl, use the right tool for the job!
> 
> #!/bin/sh
> grep -i "keyword" /path/to/test/* >/path/concatenate.txt
> grep -iv "keyword" /path/to/test/* >/path/non_concatenate.txt

You saved me typing the same suggestion!

    BugBear


------------------------------

Date: Sun, 26 Jul 2009 11:02:33 +0200
From: Martijn Lievaart <m@rtij.nl.invlalid>
Subject: Re: Concatenating selective lines from a bunch of files into a single  file
Message-Id: <9mitj6-7pb.ln1@news.rtij.nl>

On Sat, 25 Jul 2009 09:10:08 -0700, Rider wrote:

> Hi experts,
> 
> I have a unix dir, test and it has 100 files. I need to extract all the
> lines that contain a word "keyword" key word" (case insensitive) from
> each of those files and put all those lines into another file,
> concatenate.txt. Similarly, I want all the lines that don't contain that
> key word (keyword or key word) into another file, non_concatenate.txt.
> 
> I know a little bit of perl and I am wondering how can I do it here.

I would not do this in perl, use the right tool for the job!

#!/bin/sh
grep -i "keyword" /path/to/test/* >/path/concatenate.txt
grep -iv "keyword" /path/to/test/* >/path/non_concatenate.txt

HTH,
M4


------------------------------

Date: Wed, 29 Jul 2009 00:25:37 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: cpan keeps asking: "Is it OK to try to connect to the Internet?"
Message-Id: <290720090025370513%brian.d.foy@gmail.com>

In article <h4cil8$tm3$1@news.eternal-september.org>, Steve C
<smallpond@juno.com> wrote:

> Ignoramus2408 wrote:
> > I have perl 5.10.0. Whenever I would invoke cpan to install modules,
> > it would ask me "Is it OK to try to connect to the Internet?".

It sounds like you just need to configure connect_to_internet_ok. Even
though it doesn't show up in your list of options, what happens when
you try to set it?

> then change:
>                  my $answer = CPAN::Shell::colorable_makemaker_prompt("Is it
> OK to try to connect to the Internet?", "yes");
> to:
>                  # my $answer = CPAN::Shell::colorable_makemaker_prompt("Is
> it OK to try to connect to the Internet?", "yes");
>                  my $answer = "yes";  # why else would I be running CPAN?

You might be running CPAN.pm because you are accessing a local
repository or a DPAN. In that case, you want to connect only to the
sites you have configured and none of the hard-coded fallback sites.


------------------------------

Date: Tue, 28 Jul 2009 05:45:06 -0700 (PDT)
From: "claus.kick@googlemail.com" <clauskick@hotmail.com>
Subject: Re: FAQ 5.28 How can I read in an entire file all at once?
Message-Id: <5a94f70b-fe33-4de6-96ae-7ea6b529e5f4@o15g2000yqm.googlegroups.com>

On 18 Jul., 03:03, PerlFAQ Server <br...@stonehenge.com> wrote:

> --------------------------------------------------------------------
>
> 5.28: How can I read in an entire file all at once?
>
*snip*

General question: Is it common to show usage of certain module before
showing the plain (i.e. always working) solution?

If not than I would suggest switching the examples.


------------------------------

Date: Tue, 28 Jul 2009 12:15:48 -0400
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: FAQ 5.28 How can I read in an entire file all at once?
Message-Id: <874oswg4wb.fsf@quad.sysarch.com>

>>>>> "ckc" == claus kick@googlemail com <clauskick@hotmail.com> writes:

  ckc> On 18 Jul., 03:03, PerlFAQ Server <br...@stonehenge.com> wrote:
  >> --------------------------------------------------------------------
  >> 
  >> 5.28: How can I read in an entire file all at once?
  >> 
  ckc> *snip*

  ckc> General question: Is it common to show usage of certain module before
  ckc> showing the plain (i.e. always working) solution?

there is no 'plain' solution. undef'ing $/ isn't clear to most newbies
and it needs at least 3 lines of code. the only issue is that
file::slurp is not in core (which has been suggested but p5p hasn't done it).

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  --------  http://www.sysarch.com --
-----  Perl Code Review , Architecture, Development, Training, Support ------
--------- Free Perl Training --- http://perlhunter.com/college.html ---------
---------  Gourmet Hot Cocoa Mix  ----  http://bestfriendscocoa.com ---------


------------------------------

Date: Wed, 29 Jul 2009 00:21:09 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 5.28 How can I read in an entire file all at once?
Message-Id: <290720090021094448%brian.d.foy@gmail.com>

In article
<5a94f70b-fe33-4de6-96ae-7ea6b529e5f4@o15g2000yqm.googlegroups.com>,
<"claus.kick@googlemail.com"> wrote:


> General question: Is it common to show usage of certain module before
> showing the plain (i.e. always working) solution?

In general, I try to lead with the preferred solution.


------------------------------

Date: Wed, 29 Jul 2009 00:22:27 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.23 How can I match strings with multibyte characters?
Message-Id: <290720090022279111%brian.d.foy@gmail.com>

In article <h4cdua$1jcf$1@saria.nerim.net>, O_TEXT <O_TEXT@nospam.fr>
wrote:

> This seems working, however...
> however when script is obfuscated with stunnix perl ofuscator original
> Perl code is translated  to folloing Perl code which does not seam working:

If you think you should use Stunnix, check out my book Mastering Perl
where I show everyone how to defeat it.


------------------------------

Date: Wed, 29 Jul 2009 15:40:55 +0200
From: O_TEXT <O_TEXT@nospam.fr>
Subject: Re: FAQ 6.23 How can I match strings with multibyte characters?
Message-Id: <h4pjh7$2ha6$1@saria.nerim.net>

brian d foy a =E9crit :
> In article <h4cdua$1jcf$1@saria.nerim.net>, O_TEXT <O_TEXT@nospam.fr>
> wrote:
>=20
>> This seems working, however...
>> however when script is obfuscated with stunnix perl ofuscator original=

>> Perl code is translated  to folloing Perl code which does not seam wor=
king:
>=20
> If you think you should use Stunnix, check out my book Mastering Perl
> where I show everyone how to defeat it.

Thanks for this information.

The =AB Don't be evil =BB company (NASDAQ: GOOG, LSE: GGEA) let me read s=
ome
pages of this book (=ABMastering Perl=BB).

For a technical point of view, this book confirms what I thinked and
what you claims: Stunnix perl obfuscator has some technical
weaknesses/limitations.
However, it might keep usefull as it looks like obfuscated symbols names
are not technically reversible.

I never said this tool should/might be used. I just said I have to
workaround its unpredictable bugs and limitations.


For a legal point of view, I assume the program keep being protected as
some western countries legislations and some licenses might forbid
reverse engineering on not owned software.



------------------------------

Date: Wed, 29 Jul 2009 16:52:04 -0500
From: brian d  foy <brian.d.foy@gmail.com>
Subject: Re: FAQ 6.23 How can I match strings with multibyte characters?
Message-Id: <290720091652048756%brian.d.foy@gmail.com>

In article <h4pjh7$2ha6$1@saria.nerim.net>, O_TEXT <O_TEXT@nospam.fr>
wrote:

> For a technical point of view, this book confirms what I thinked and
> what you claims: Stunnix perl obfuscator has some technical
> weaknesses/limitations.
> However, it might keep usefull as it looks like obfuscated symbols names
> are not technically reversible.

Well, you don't get the original names back, but there are ways to make
the names readable, which I also showed, as I recall.

The point is to not waste your time. For Stunnix to be useful, your
code has to be hard to follow to start with. If you're using good
programming techniques with short scopes, minimally-tasked subroutines,
and so on, changing variable names is just a speed bump. If you don't
want to use good practices, well, do whatever you like then. :)


------------------------------

Date: 6 Apr 2001 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 6 Apr 01)
Message-Id: <null>


Administrivia:

#The Perl-Users Digest is a retransmission of the USENET newsgroup
#comp.lang.perl.misc.  For subscription or unsubscription requests, send
#the single line:
#
#	subscribe perl-users
#or:
#	unsubscribe perl-users
#
#to almanac@ruby.oce.orst.edu.  

NOTE: due to the current flood of worm email banging on ruby, the smtp
server on ruby has been shut off until further notice. 

To submit articles to comp.lang.perl.announce, send your article to
clpa@perl.com.

#To request back copies (available for a week or so), send your request
#to almanac@ruby.oce.orst.edu with the command "send perl-users x.y",
#where x is the volume number and y is the issue number.

#For other requests pertaining to the digest, send mail to
#perl-users-request@ruby.oce.orst.edu. Do not waste your time or mine
#sending perl questions to the -request address, I don't have time to
#answer them even if I did know the answer.


------------------------------
End of Perl-Users Digest V11 Issue 2529
***************************************


home help back first fref pref prev next nref lref last post