[28835] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 79 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Jan 26 11:06:26 2007

Date: Fri, 26 Jan 2007 08:05:09 -0800 (PST)
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, 26 Jan 2007     Volume: 11 Number: 79

Today's topics:
        ANNOUNCE: Xorg configuration model dominique.dumont@hp.com
        Fork in windows <rafael.avaria@gmail.com>
        How can I convert a scalar to a range list ??? hekutu@gmail.com
    Re: How can I convert a scalar to a range list ??? anno4000@radom.zrz.tu-berlin.de
    Re: How can I convert a scalar to a range list ??? <mritty@gmail.com>
    Re: How can I convert a scalar to a range list ??? <mritty@gmail.com>
    Re: How can I convert a scalar to a range list ??? <wahab-mail@gmx.de>
    Re: How can I convert a scalar to a range list ??? <wahab-mail@gmx.de>
    Re: How can I convert a scalar to a range list ??? <bik.mido@tiscalinet.it>
    Re: Is there a delete operator in Perl? <tzz@lifelogs.com>
    Re: loop won't run, for ( my $i = 10 ; $i == 1 ; etc anno4000@radom.zrz.tu-berlin.de
    Re: problems regexp <bik.mido@tiscalinet.it>
        Removing HTML <bill@ts1000.us>
    Re: Removing HTML <simon.andrews@bbsrc.ac.uk>
    Re: Removing HTML <mritty@gmail.com>
    Re: Sort on multiple values <bik.mido@tiscalinet.it>
    Re: Sort on multiple values <ppi@searchy.net>
    Re: Sort on multiple values anno4000@radom.zrz.tu-berlin.de
    Re: String Substitution question <wahab-mail@gmx.de>
    Re: Style questions <tadmc@augustmail.com>
    Re: Style questions <tzz@lifelogs.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 26 Jan 2007 13:43:57 GMT
From: dominique.dumont@hp.com
Subject: ANNOUNCE: Xorg configuration model
Message-Id: <JCHDIB.t3D@zorch.sf-bay.org>


Hello

I'm happy to announce the very first version of a Xorg configuration
model [1] for Config::Model [2] perl module.

With this module and Config::Model, you have a tool to modify the
configuration of your favourite X server.

Once this module is installed, you can run (as root, but please backup
/etc/X11/xorg.conf before):

  # config-model -root_model Xorg

You may want to try it safely first by writing the resulting xorg.conf
elsewhere (in this case you can run this command with your user
account):

  $ config-model -root_model Xorg -write_directory test 

Be sure to read the README file [3] and this doc [4] which explain the
basic command of the interface.

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

At this point, config-model and its xorg model are still preliminary.

A lot of work still needs to be done. For instance the current UI is a
command line. Config::Model needs more friendly users interfaces. I
have some code to provide a Curses UI that I will release in a few
weeks. I could use some help to provide a GUI or a Webmin interface.

On xorg model side, I've provided a rather complete model (according
to the documentation) for radeon driver and a basic model for nvidia
drivers. The model could also use improvements to better classify xorg
parameter according to their status (e.g. standard, deprecated...) or
permission level (e.g. intermediate, advanced or master depending on
the required skills).

Now, I'd welcome some feedback or help:

- What do you think of this approach: separate model declaration and
  configuration handling ?

- Do you think it can be applied to other applications ?

- If yes, for which application would you like a configuration model ?

- Do you think Config::Model should be integrated to other config
  tools ? Which ones ?


Thanks for your time

Cheers

[1] http://search.cpan.org/dist/Config-Model-Xorg/
[2] http://search.cpan.org/dist/Config-Model/
[3] http://search.cpan.org/src/DDUMONT/Config-Model-Xorg-0.5/README
[4] http://search.cpan.org/dist/Config-Model/TermUI.pm#USER_COMMAND_SYNTAX

-- 
Dominique Dumont 
"Delivering successful solutions requires giving people what they
need, not what they want." Kurt Bittner




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

Date: 26 Jan 2007 05:33:21 -0800
From: "lala4life" <rafael.avaria@gmail.com>
Subject: Fork in windows
Message-Id: <1169818401.203243.199070@l53g2000cwa.googlegroups.com>

Hi gurus.
     I have some code using fork, work nice in linux. but it really
portable to win32?
     hare is a snippet of the code.

    in linux i use ps -xuaf and view the parent and his child process,
but in win32 i'n not sure about fork.

          FORK:{

            if ( $pid = fork &&  $max_openprocs++ < 11 ){
	      #parent process
              push @PROC_LIST,$pid;

            } elsif (defined($pid) &&  $max_openprocs < 10 ) {
	      # child process

	      if (!&trigger_link( $opt_url)){
                # write a log message
                 open OUT, ">>$cronv_varglb::LOG_FILE" or die 'i cont ;
                 print OUT  "# ".scalar localtime()."  Can't access to
$opt_url by method GET \r\n";
	         close OUT;

              };
	      exit;
	    } elsif ($! =~ /no more process/ || $max_openprocs > 10 ) {
                #try to restore.
                sleep 5;
                #wait for  5 process ... and delete them from
@PROC_LIST
                foreach my $i (0 ..$#PROC_LIST){
                   waitpid $PROC_LIST[$i],0;
                   delete $PROC_LIST[$i];
                   last if ($i == 5);
                }
	        $max_openprocs = 5;
                redo FORK;
            } else {
             # fatal Error, write log message
             open OUT, ">>$cronv_varglb::LOG_FILE" or die 'Can't opent
Log file';
             print OUT  "# ".localtime()."Fatal Error  can't do a fork
[$!] \r\n";
	           close OUT;
             die "Can't use fork[$!]\n";
            }; # if
         };# FORK



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

Date: 26 Jan 2007 03:35:23 -0800
From: hekutu@gmail.com
Subject: How can I convert a scalar to a range list ???
Message-Id: <1169811323.692606.75740@h3g2000cwc.googlegroups.com>

Dear all:

The follwing small program runs well.
==================
my @b = (1..10);
print @b;
==================
The output is:12345678910

But I want to replace the range list with a
flexible scalar, the new program looks like:
=========================
my $a = "(1..10)";
my @b = $a;
print @b;
=========================
The output is:(1..10)

The scalar is still the scalar. How can I convert
the text scalar "(1..10)" to a range list?

Thank you!



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

Date: 26 Jan 2007 11:48:31 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: How can I convert a scalar to a range list ???
Message-Id: <51u84fF1lc7vsU2@mid.dfncis.de>

 <hekutu@gmail.com> wrote in comp.lang.perl.misc:
> Dear all:
> 
> The follwing small program runs well.
> ==================
> my @b = (1..10);
> print @b;
> ==================
> The output is:12345678910
> 
> But I want to replace the range list with a
> flexible scalar, the new program looks like:
> =========================
> my $a = "(1..10)";

Avoid the variables names $a and $b.  They can mess up sort routines.

> my @b = $a;
> print @b;
> =========================
> The output is:(1..10)
> 
> The scalar is still the scalar. How can I convert
> the text scalar "(1..10)" to a range list?

I'm not sure what you mean exactly, but try

    my $x = join '', 1 .. 10;

Anno


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

Date: 26 Jan 2007 03:56:26 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: How can I convert a scalar to a range list ???
Message-Id: <1169812586.332502.25090@q2g2000cwa.googlegroups.com>

On Jan 26, 6:35 am, hek...@gmail.com wrote:
> But I want to replace the range list with a
> flexible scalar, the new program looks like:
> =========================
> my $a = "(1..10)";
> my @b = $a;
> print @b;
> =========================
> The output is:(1..10)
>
> The scalar is still the scalar. How can I convert
> the text scalar "(1..10)" to a range list?

I'm wary to give this answer, because if you don't understand its
dangers, you can really mess things up.  Regardless, it is the actual
answer to your question.  The function that converts a plain string to
executable Perl code is C<eval>.  Before reading further, or trying it
out, *please* read:
perldoc -f eval

Once you've read that, take a look at this sample solution:
$ perl -le'
my $x = q{(1..10)};
my @y = eval $x;
print "@y";
'
1 2 3 4 5 6 7 8 9 10

Please make sure you understand the dangers involved here.  If $x could
be any user-entered string, avoid this method like the plague.  Use it
if and ONLY if you are 100% sure you know the possible values this
string can have.   (Consider for example, what would happen if the user
did not enter "(1..10)", but instead "system('rm -rf /home/')" )

At the very least, you should be checking the format of the
user-entered string:

if ($x !~ /^\(\d+\.\.\d+\)$/) {
   die "'$x' not in correct format!!\n";
}

Paul Lalli



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

Date: 26 Jan 2007 03:59:19 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: How can I convert a scalar to a range list ???
Message-Id: <1169812759.432285.33200@q2g2000cwa.googlegroups.com>

On Jan 26, 6:56 am, "Paul Lalli" <mri...@gmail.com> wrote:
> On Jan 26, 6:35 am, hek...@gmail.com wrote:
>
> > But I want to replace the range list with a
> > flexible scalar, the new program looks like:
> > =========================
> > my $a = "(1..10)";
> > my @b = $a;
> > print @b;
> > =========================
> > The output is:(1..10)
>
> > The scalar is still the scalar. How can I convert
> > the text scalar "(1..10)" to a range list?I'm wary to give this answer, because if you don't understand its
> dangers, you can really mess things up.  Regardless, it is the actual
> answer to your question.  The function that converts a plain string to
> executable Perl code is C<eval>.  Before reading further, or trying it
> out, *please* read:
> perldoc -f eval
>
> Once you've read that, take a look at this sample solution:
> $ perl -le'
> my $x = q{(1..10)};
> my @y = eval $x;
> print "@y";
> '
> 1 2 3 4 5 6 7 8 9 10
>
> Please make sure you understand the dangers involved here.  If $x could
> be any user-entered string, avoid this method like the plague.  Use it
> if and ONLY if you are 100% sure you know the possible values this
> string can have.   (Consider for example, what would happen if the user
> did not enter "(1..10)", but instead "system('rm -rf /home/')" )
>
> At the very least, you should be checking the format of the
> user-entered string:
>
> if ($x !~ /^\(\d+\.\.\d+\)$/) {
>    die "'$x' not in correct format!!\n";
> }


 ... and even as I pushed the Post button, I realized the advice I
should have given.  Abandon eval().  Completely.  Instead retain that
pattern match above, and use that to get your range:

my @y;
if ($x =~ /^\((\d+)\.\.\(d+)\)$/) {
    @y = ($1..$2);
} else {
    die "'$x' not in correct format!!\n";
}

Much better.

Paul Lalli



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

Date: Fri, 26 Jan 2007 13:07:04 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: How can I convert a scalar to a range list ???
Message-Id: <epcr7d$s6m$1@mlucom4.urz.uni-halle.de>

hekutu@gmail.com wrote:
> my $a = "(1..10)";
> my @b = $a;
> print @b;
> =========================
> The output is:(1..10)
> 
> The scalar is still the scalar. How can I convert
> the text scalar "(1..10)" to a range list?

Aside from Anno's notation
of the Perl standard idiom:

{
   my $rangestring = join '', 1 .. 10;
}

you could, depending on your
program and your goals, use
any other method that constructs
strings from array/list elements,
like:

{
   my $rangestring = '';
   $rangestring .= $_ for 1..10;
}


{
   local $" = '';
   my $rangestring = "@{ [1..10] }";
}


(But use Anno's if possible)

Regards

M.


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

Date: Fri, 26 Jan 2007 13:29:32 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: How can I convert a scalar to a range list ???
Message-Id: <epcshh$smu$1@mlucom4.urz.uni-halle.de>

Mirco Wahab wrote:

After misinterpreting your intention
and reading Pauls article ...

Could a "closure" be the solution?

   my $range = sub { (1..10) };

   ...
   ...

   my @array = & $range;
   # or
   # my @array = $range->();

Regards

M.


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

Date: Fri, 26 Jan 2007 15:05:53 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: How can I convert a scalar to a range list ???
Message-Id: <v72kr21lk63lnqbdq16p7c9qpeekao6cfa@4ax.com>

On 26 Jan 2007 03:35:23 -0800, hekutu@gmail.com wrote:

>my $a = "(1..10)";
>my @b = $a;
>print @b;
>=========================
>The output is:(1..10)
>
>The scalar is still the scalar. How can I convert
>the text scalar "(1..10)" to a range list?

As others explained you the strict answer to your question would be to
use string eval(). But as others also explained eval() and in
particular string eval() is evil(TM). Thus you can use a workaround
like the one suggested by Paul Lalli: use a regex to validate your
scalar and extract the range extremes, and use them to build the range
itself. OTOH it seems strange to me that you have the exact "(1..10)"
scalar rather than the extremes in the first place, so I smell some
degree of XY problem (see e.g.
<http://perlmonks.org/?node=XY+problem>) here. What are you really
trying to do?


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Fri, 26 Jan 2007 10:33:42 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Is there a delete operator in Perl?
Message-Id: <g69zm85pzu1.fsf@dhcp-65-162.kendall.corp.akamai.com>

On 25 Jan 2007, xhoster@gmail.com wrote:

> Ted Zlatanov <tzz@lifelogs.com> wrote:
> > I'd say instead you should write your code to work correctly
> > first, then worry about optimizing for speed.

> While that is generally true, it sounds to me like he is implementing some
> kind of fancy LRU cache.  If that is the case, I'd say he is already in
> the "optimizing for speed" stage.

No, it's *always* true you should not optimize prematurely.  Correct
code is absolutely essential.  At worst, you can use the correct but
slow code to write a test, and compare the results to the fast but
possibly buggy method you write subsequently.

Ted


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

Date: 26 Jan 2007 11:37:48 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: loop won't run, for ( my $i = 10 ; $i == 1 ; etc
Message-Id: <51u7gcF1lc7vsU1@mid.dfncis.de>

DJ Stunks <DJStunks@gmail.com> wrote in comp.lang.perl.misc:
> On Jan 25, 4:38 pm, Justin C <justin.0...@purestblue.com> wrote:
> > On 2007-01-25, Paul Lalli <mri...@gmail.com> wrote:
> >
> > > On Jan 25, 11:45 am, Justin C <justin.0...@purestblue.com> wrote:
> >
> > >>     for ( my $pg_count = 15 ; $pg_count == 0 ; $pg_count-- ) {
> >
> > > Your
> > > confusion seems to be in thinking that the loop executes *until* the
> > > test is true.  Not so - it executes *while* the test is true.  Change
> > > your test to:
> > > $pgcount > 0
> >
> > Thank you Paul, and Cliff, for clear, concise answers.
> 
> > I don't use this type of loop very often
> 
> Nobody does, because it's very rare you can't use a Perl for:
> 
>   C:\>perl -e "print qq[$_,] for reverse 0..15"
>   15,14,13,12,11,10,9,8,7,6,5,4,3,2,1,0,

True, but Justin's original example was essentially

    for ( my $i = 5; $i >= 0; -- $i ) {
        # ...
        -- $i; # extra decrement
        # ...
    }

Intentionally or not, this is an example where the C-Style loop
is not easily replaced with a Perl style for loop.

    for my $i ( reverse 5 .. 0 ) {
        # ...
        -- $i; # extra decrement
        # ...
    }

behaves quite differently.

Anno


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

Date: Fri, 26 Jan 2007 12:31:38 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: problems regexp
Message-Id: <nhpjr2p81drfsffec30jkm5e9r86qt888a@4ax.com>

On Fri, 26 Jan 2007 11:13:55 +0100, "Dr.Ruud"
<rvtol+news@isolution.nl> wrote:

>> if($data{attachement} = ~m/$`\.gif/){
>
>
>Or try substr: 
>
>  if ( substr($data{attachement}, -4) eq q/.gif/ ) {

Or File::Basename's basename().


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: 26 Jan 2007 03:45:04 -0800
From: "Bill H" <bill@ts1000.us>
Subject: Removing HTML
Message-Id: <1169811904.225044.310790@j27g2000cwj.googlegroups.com>

Does anyone have an easy/fast way of removing HTML tags from a text
file using perl? I am using the following brute force way of doing it,
which does work, but can be a little slow:

        $body = substr($body,0,$a);

                while(index($body,"<") != -1)
                {
                    $a = index($body,"<");
                    $beg = substr($body,0,$a);
                    $body = substr($body,$a + 1)." ";
                    $a = index($body,">");
                    $fin = substr($body,$a + 1);
                    $body = $beg.$fin;
                }
                $body =~ s/  / /gi;



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

Date: Fri, 26 Jan 2007 12:32:17 +0000
From: Simon Andrews <simon.andrews@bbsrc.ac.uk>
Subject: Re: Removing HTML
Message-Id: <epcsch$gks$1@south.jnrs.ja.net>

Bill H wrote:
> Does anyone have an easy/fast way of removing HTML tags from a text
> file using perl? 

use HTML::Strip;

my $hs = HTML::Strip->new();
my $clean_text = $hs->parse( $raw_html );
$hs->eof;

http://search.cpan.org/~kilinrax/HTML-Strip-1.06/Strip.pm

HTH

Simon.


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

Date: 26 Jan 2007 05:00:53 -0800
From: "Paul Lalli" <mritty@gmail.com>
Subject: Re: Removing HTML
Message-Id: <1169816453.887623.75350@k78g2000cwa.googlegroups.com>

On Jan 26, 6:45 am, "Bill H" <b...@ts1000.us> wrote:
> Does anyone have an easy/fast way of removing HTML tags from a text
> file using perl?

Please check the built-in Perl FAQ *before* posting to a world-wide
group asking people to read it for you. . .

$ perldoc -q html
Found in /opt2/Perl5_8_4/lib/perl5/5.8.4/pod/perlfaq9.pod
     How do I remove HTML from a string?

Also available on the web at:
http://perldoc.perl.org/perlfaq9.html#How-do-I-remove-HTML-from-a-string%3F

Paul Lalli



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

Date: Fri, 26 Jan 2007 12:36:34 +0100
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: Sort on multiple values
Message-Id: <dlpjr2l5u7992fprr7deqg0khgg7uhsg3a@4ax.com>

On Fri, 26 Jan 2007 10:18:39 +0100, Frank <ppi@searchy.net> wrote:

>%hash_sort = sort {
>   $hash{$a}{'1'} cmp $hash{$b}{'1'} || $hash{$a}{'1'} cmp $hash{$b}{'2'}
                                                    ^
                                                    ^

>} keys(%hash);

You can't "sort a hash" like that. A hash is an intrinsically unsorted
object. You're creating a hash having for keys some of the keys of the
original ones, and for values some other of them. You can order the
*keys* of a hash, and use such a sorted list to print the key valuse
pairs of it in some ordered fashion you like. But that's a whole
different story. 

Incidentally, I also think you may want the underlined 1 above to be a
2.


Michele
-- 
{$_=pack'B8'x25,unpack'A8'x32,$a^=sub{pop^pop}->(map substr
(($a||=join'',map--$|x$_,(unpack'w',unpack'u','G^<R<Y]*YB='
 .'KYU;*EVH[.FHF2W+#"\Z*5TI/ER<Z`S(G.DZZ9OX0Z')=~/./g)x2,$_,
256),7,249);s/[^\w,]/ /g;$ \=/^J/?$/:"\r";print,redo}#JAPH,


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

Date: Fri, 26 Jan 2007 14:25:00 +0100
From: Frank <ppi@searchy.net>
Subject: Re: Sort on multiple values
Message-Id: <45ba0137$0$332$e4fe514c@news.xs4all.nl>

Michele Dondi wrote:
> On Fri, 26 Jan 2007 10:18:39 +0100, Frank <ppi@searchy.net> wrote:
> 
>> %hash_sort = sort {
>>   $hash{$a}{'1'} cmp $hash{$b}{'1'} || $hash{$a}{'1'} cmp $hash{$b}{'2'}
>                                                     ^
>                                                     ^
> 
>> } keys(%hash);
> 
> 
> Incidentally, I also think you may want the underlined 1 above to be a
> 2.

Yup I did, typed too fast from the script I use it in. But that wasn't 
really the problem because I've changed that part of the script several 
times in attempt to let it work ;)


> 
> 
> Michele


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

Date: 26 Jan 2007 13:55:30 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Sort on multiple values
Message-Id: <51ufiiF1ltkm6U1@mid.dfncis.de>

Frank  <ppi@searchy.net> wrote in comp.lang.perl.misc:
> Michele Dondi wrote:
> > On Fri, 26 Jan 2007 10:18:39 +0100, Frank <ppi@searchy.net> wrote:
> > 
> >> %hash_sort = sort {
> >>   $hash{$a}{'1'} cmp $hash{$b}{'1'} || $hash{$a}{'1'} cmp $hash{$b}{'2'}
> >                                                     ^
> >                                                     ^
> > 
> >> } keys(%hash);
> > 
> > 
> > Incidentally, I also think you may want the underlined 1 above to be a
> > 2.
> 
> Yup I did, typed too fast from the script I use it in.

Don't re-type code, copy/paste it from a working script.

> But that wasn't 
> really the problem because I've changed that part of the script several 
> times in attempt to let it work ;)

It may not be *your* problem but you make it a lot harder for us to
understand what you're trying to do.  Debugging code is hard.  Debugging
code that may not be the real code is near impossible.

Anno


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

Date: Fri, 26 Jan 2007 12:42:00 +0100
From: Mirco Wahab <wahab-mail@gmx.de>
Subject: Re: String Substitution question
Message-Id: <epcpod$rrm$1@mlucom4.urz.uni-halle.de>

Dr.Ruud wrote:
> Alternatives:
>       my $m = q:[: . quotemeta( q:()[]?*.$+_-: ) . q:]: ;

Of course, dropping the @stuff makes things smaller ;-)

> $ perl -wle'
>   my $m = q:][()?*.$+_-: ;
>   print qr/[$m]/
> '
> (?-xism:[][()?*.$+_-])

OK, but wouldn't this throw an 'unmatched  ] bracket'
or something when used on strings with '] ['

No, it doesn't. I did *not* expect this would work:

    my $content = '
     Hello ( zszs ) hs $ jjs + owow - kshs ? hhshs [ tetet [] hshs!
    ';

    my $m = '][()?*.$+_-';
    $content =~ s/[$m]//g;
    print $content;


 ... and still roll my eyes!

Thanks for clearing this up,

M.


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

Date: Fri, 26 Jan 2007 06:04:24 -0600
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: Style questions
Message-Id: <slrnerjri8.rr.tadmc@tadmc30.august.net>

Michele Dondi <bik.mido@tiscalinet.it> wrote:

> Personally I have an idiosincrasy with
> backticks and prefer qx with alternative delimiters, but that's just
                                                                  ^^^^
> me.
  ^^

No it isn't.

:-)


-- 
    Tad McClellan                          SGML consulting
    tadmc@augustmail.com                   Perl programming
    Fort Worth, Texas


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

Date: Fri, 26 Jan 2007 10:39:19 -0500
From: Ted Zlatanov <tzz@lifelogs.com>
Subject: Re: Style questions
Message-Id: <g69sldxpzko.fsf@dhcp-65-162.kendall.corp.akamai.com>

On 25 Jan 2007, cbigam@somewhereelse.nucleus.com wrote:

> And more specifically, I've got the following general case that keeps coming
> up routinely.
>
> foreach (`some_unix_command_that_puts_out_multiple_lines`) {
> 	chomp;
> 	split;
> 	(do_stuff_on_the_separate_fields);
> }
>
> Anything to fix up there?

I prefer to open "some_unix_command_that_puts_out_multiple_lines|" as
a file and read it line by line.  You can catch errors more easily
that way.

Ted


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

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 79
*************************************


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