[23139] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 5360 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Aug 14 14:15:47 2003

Date: Thu, 14 Aug 2003 11:15:22 -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           Thu, 14 Aug 2003     Volume: 10 Number: 5360

Today's topics:
        Q: hash of arrays (g)
    Re: Q: hash of arrays <nap@illx.org>
    Re: Q: hash of arrays <g4rry.sh0rt@zw4llet.com>
    Re: Q: hash of arrays <simonis@myself.com>
    Re: Q: hash of arrays (Tad McClellan)
        Question about "eval" security <hisao@physics.purdue.edu>
    Re: Question about "eval" security (Tad McClellan)
        Question about logic related to a range of numbers <charlest@indysoft.com>
    Re: Question about logic related to a range of numbers (Tad McClellan)
        Quoting (was 'Bug in perl?') <usenet@dwall.fastmail.fm>
    Re: Quoting (was 'Bug in perl?') <mdudley@execonn.com>
    Re: Quoting (was 'Bug in perl?') <ian@WINDOZEdigiserv.net>
    Re: replace space only within quotes with something els (Tad McClellan)
    Re: Simple tr/// script (Tad McClellan)
    Re: Simple tr/// script <l0g0m0tion@earthlink.net>
        strange error  "Unsuccessful stat on filename " <randy_chang@sohu.com>
    Re: strange error  "Unsuccessful stat on filename " <michael.p.broida@boeing.com>
    Re: Suggestions for further perl reading <uri@stemsystems.com>
    Re: using Getopt::Long with option value having spaces (Tad McClellan)
    Re: using Getopt::Long with option value having spaces <bart.lateur@pandora.be>
    Re:  <bwalton@rochester.rr.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 14 Aug 2003 08:16:28 -0700
From: gina.joue@ucd.ie (g)
Subject: Q: hash of arrays
Message-Id: <c40b4026.0308140716.12b5d71@posting.google.com>

Hi,

Given a key, I'm trying to access a specific array in a hash of
arrays. I'm not having much luck....


## Following the Perl docs, I populate the hash of arrays this way:
foreach $sonKey ( keys %son ) {
  push @{ $sonRev{$sonKey} }, $son{$sonKey};
}


## This, based on the Perl docs, does work 
## in accessing all the elements in the hash of arrays:
foreach $sonKey ( keys %sonRev ) {
    print "theAnswer: ";
    foreach $i ( 0 .. $#{ $sonRev{$sonKey} } ) {
	print " $sonKey = $sonRev{$sonKey}[$i]";
    }
    print "\n";
}

## But the following doesn't work at all -- nothing is printed
$aKey = 13;

foreach $i ( 0 .. $#{ $sonRev{$aKey} } )  {
   print "the sonKey for $aKey is $sonRev{$aKey}[$i]\n";
}


What am I doing wrong?

g


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

Date: Thu, 14 Aug 2003 09:35:26 -0600
From: Nick Pinckernell <nap@illx.org>
Subject: Re: Q: hash of arrays
Message-Id: <87d6f89rr5.fsf@blitz.illx.org>


What data does your original hash %son have in it?
From your code, I don't see you populating the hash
anywhere.

Because you should just be able to get your ary by:

my @ary = @{$sonRev{"$key"}};

_nick


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

Date: Thu, 14 Aug 2003 16:53:24 +0000
From: Garry Short <g4rry.sh0rt@zw4llet.com>
Subject: Re: Q: hash of arrays
Message-Id: <3f3bb08a$0$46010$65c69314@mercury.nildram.net>

g wrote:

> Hi,
> 
> Given a key, I'm trying to access a specific array in a hash of
> arrays. I'm not having much luck....
> 
> 
> ## Following the Perl docs, I populate the hash of arrays this way:
> foreach $sonKey ( keys %son ) {
>   push @{ $sonRev{$sonKey} }, $son{$sonKey};
> }
> 

Okay, I *must* be missing something, because my first question is:
1. If you're populating a new hash, surely there are no keys for the foreach
statement to work on?
2. Push works on arrays; why are you trying to use it to populate a hash?

Assuming that all your data is in a file, that you have a key followed by
the entire array, all comma-delimited, you'd do something like:

my %sonRev;
open FILE, $some_file or die "Can't open $some_file: $!\n";
while (<FILE>) {
  shift;
  my ($sonKey, @array) = split /,/;
  $sonRev{$sonKey} = [ @array ];
}
close FILE;

This would create a hash of arrays.

<SNIP>
> 
> ## But the following doesn't work at all -- nothing is printed
> $aKey = 13;
> 
> foreach $i ( 0 .. $#{ $sonRev{$aKey} } )  {
>    print "the sonKey for $aKey is $sonRev{$aKey}[$i]\n";
> }
> 
> 
> What am I doing wrong?
> 
> g

foreach $sonKey (sort keys %sonRev) {
  print "sonKey = $sonKey; Array = @{ $sonRev{$sonKey} }";
}

prints out the whole hash. If your data is :
1,a,b,c,d
2,e,f,g
3,h,i,j,k,l,m,n
4,o,p,q,r
5,s,t
6,u,v,w,x,y,z
:

you'll get 

1 = a b c d
2 = e f g
3 = h i j k l m n
4 = o p q r
5 = s t
6 = u v w x y z

HTH,

Garry.

Complete test code as follows:
      1 my %sonRev;
      2 while (<DATA>) {
      3   shift;
      4   ($sonKey, @array) = split /,/;
      5   $sonRev{$sonKey} = [ @array ];
      6 }
      7 foreach $sonKey (sort keys %sonRev) {
      8   print "$sonKey = @{ $sonRev{$sonKey} }";
      9 }
     10
     11 __DATA__
     12 1,a,b,c,d
     13 2,e,f,g
     14 3,h,i,j,k,l,m,n
     15 4,o,p,q,r
     16 5,s,t
     17 6,u,v,w,x,y,z



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

Date: Thu, 14 Aug 2003 16:11:07 GMT
From: simonis <simonis@myself.com>
Subject: Re: Q: hash of arrays
Message-Id: <3F3BB483.F46352D7@myself.com>

g wrote:
> 
> Hi,
> 
> Given a key, I'm trying to access a specific array in a hash of
> arrays. I'm not having much luck....
> 
> ## Following the Perl docs, I populate the hash of arrays this way:
> foreach $sonKey ( keys %son ) {
>   push @{ $sonRev{$sonKey} }, $son{$sonKey};
> }
> 
> ## This, based on the Perl docs, does work
> ## in accessing all the elements in the hash of arrays:
> foreach $sonKey ( keys %sonRev ) {
>     print "theAnswer: ";
>     foreach $i ( 0 .. $#{ $sonRev{$sonKey} } ) {
>         print " $sonKey = $sonRev{$sonKey}[$i]";
>     }
>     print "\n";
> }
> 
> ## But the following doesn't work at all -- nothing is printed
> $aKey = 13;
> 
> foreach $i ( 0 .. $#{ $sonRev{$aKey} } )  {
>    print "the sonKey for $aKey is $sonRev{$aKey}[$i]\n";
> }
> 
> What am I doing wrong?

I whipped together a sample program and can't duplicate a problem,
what specifically does your program output?  Any errors?  Are you 
using warnings?  Can you include the actual program, not just a 
snippet?  Can you also include a small data sample?

Also, if this works:

> foreach $sonKey ( keys %sonRev ) {
>     print "theAnswer: ";
>     foreach $i ( 0 .. $#{ $sonRev{$sonKey} } ) {
>         print " $sonKey = $sonRev{$sonKey}[$i]";
>     }
>     print "\n";
> }

does this work?

#foreach $sonKey ( keys %sonRev ) {
$sonKey = 13;
    print "theAnswer: ";
    foreach $i ( 0 .. $#{ $sonRev{$sonKey} } ) {
        print " $sonKey = $sonRev{$sonKey}[$i]";
    }
    print "\n";
}


??


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

Date: Thu, 14 Aug 2003 11:10:21 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Q: hash of arrays
Message-Id: <slrnbjnd3d.7g4.tadmc@magna.augustmail.com>

g <gina.joue@ucd.ie> wrote:

> I'm trying to access a specific array in a hash of
> arrays.


> What am I doing wrong?


Not providing a short and complete program that we can run,
as suggested in the Posting Guidelines.

--------------------------
#!/usr/bin/perl
use strict;
use warnings;

my %son = ( 13 => 'thirteen' );
my %sonRev;

foreach my $sonKey ( keys %son ) {
  push @{ $sonRev{$sonKey} }, $son{$sonKey};
}

my $aKey = 13;
foreach my $i ( 0 .. $#{ $sonRev{$aKey} } )  {
   print "the sonKey for $aKey is $sonRev{$aKey}[$i]\n";
}
--------------------------


Works fine for me...


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


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

Date: Thu, 14 Aug 2003 10:30:35 -0500
From: "H. Nakanishi" <hisao@physics.purdue.edu>
Subject: Question about "eval" security
Message-Id: <bhg9u3$oc2$1@mozo.cc.purdue.edu>

I wish to use "eval" on a user input but want to make sure security is not
compromised. What I want is just to allow variable interpolation but not any
executions. Would something like:

eval qq/"$userinput"/;

work? As far as I could test it, it seems to do the job (i.e., does evaluate
any valid variables in $userinput but refuse to execute any commands in it.
(If I take the double quotes out, then it would execute commands - which is
very bad. I want to make sure that this is OK as far as security.

Thanks in advance.
H. Nakanishi




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

Date: Thu, 14 Aug 2003 12:30:44 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Question about "eval" security
Message-Id: <slrnbjnhq4.7lc.tadmc@magna.augustmail.com>

H. Nakanishi <hisao@physics.purdue.edu> wrote:

> I wish to use "eval" on a user input 


Why do you wish to use "eval" on a user input?

That is a very dangerous thing to wish for (especially in a
university environment).

You can nearly always redesign your application so that you can
get what you want without resorting to the evil eval EXPR.


> but want to make sure security is not
> compromised. 


Then you have enabled taint checking already?


> What I want is just to allow variable interpolation but not any
> executions. 


Interpoloation _does_ allow "executions"...


> Would something like:
> 
> eval qq/"$userinput"/;
> 
> work? 


No.


> As far as I could test it, it seems to do the job (i.e., does evaluate
> any valid variables in $userinput but refuse to execute any commands in it.


Try it with:

   my $userinput = '@{[  print q(ouch!)  ]}';

then pretend it said unlink( <* .*> ) instead of print()...

See "perldoc -q expand" for what is going on there.


> I want to make sure that this is OK as far as security.


The proper way to go about it is to decide what you want to allow,
and then write a pattern match that will match only those things
that you want to allow.

This is almost for sure an XY-problem.

What is it that you really want to accomplish? We can probably help
you do that _without_ eval()...


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


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

Date: Thu, 14 Aug 2003 10:22:31 -0400
From: "Charles R. Thompson" <charlest@indysoft.com>
Subject: Question about logic related to a range of numbers
Message-Id: <vjn6p8h4j09334@corp.supernews.com>

I've been working on a script to parse IP addresses for a web reporting
system and found an oddity I can't explain. This is probably somethign
perfectly elementary but it escapes me. Given this logic where $1=211,
$lowrange=208 and $highrange=211 the OutputHTML, etc is never called. If I
extend highrange to 212 then everything is fine.

I'm just going to assume I've done something perfectly dumb cause I don't
get it. Am I doing something incorrect with some operators here?

if (($1 >= $lowrange) && ($1 <= $highrange)){
   OutputHTML($AddressAliases{$entry}, $addresstoreplace);
   $found = 1;
   last;
}




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

Date: Thu, 14 Aug 2003 10:35:42 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Question about logic related to a range of numbers
Message-Id: <slrnbjnb2e.7ec.tadmc@magna.augustmail.com>

Charles R. Thompson <charlest@indysoft.com> wrote:

> This is probably somethign
> perfectly elementary but it escapes me.


I'll make a guess.

It has something to do with the value in $1, but since we don't
have access to the code that puts a value into $1 we cannot help.


> I'm just going to assume I've done something perfectly dumb 


Please (still) read the Posting Guidelines at least once in a while.


> cause I don't
> get it. Am I doing something incorrect with some operators here?


No. So the problem must be elsewhere.


> if (($1 >= $lowrange) && ($1 <= $highrange)){


        First make a short (less than 20-30 lines) and *complete* program
        that illustrates the problem you are having. People should be able
        to run your program by copy/pasting the code from your article. (You
        will find that doing this step very often reveals your problem
        directly. Leading to an answer much more quickly and reliably than
        posting to Usenet.)

If had followed the suggestion in the guidelines, then we would
surely be able to solve your problem.

But you didn't, so we can't.

It wouldn't have been hard to do:

----------------------------------------------
#!/usr/bin/perl
use strict;
use warnings;

my $foo = 211;
my $lowrange=208;
my $highrange=211;

if (($foo >= $lowrange) && ($foo <= $highrange)){
   print "in range\n";
}
else {
   print "out of range\n";
}
----------------------------------------------


Works fine for me...


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


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

Date: Thu, 14 Aug 2003 15:39:36 -0000
From: "David K. Wall" <usenet@dwall.fastmail.fm>
Subject: Quoting (was 'Bug in perl?')
Message-Id: <Xns93D7769D0D63Bdkwwashere@216.168.3.30>


It's not a bug.


Marshall Dudley <mdudley@execonn.com> wrote:

> Perl 5.005_03 built for 386 freeBSD

freeBSD doesn't sound very Windows-ish.  :-)

There are more recent versions of Perl, too.


> I am trying to get perl to work on a windows system for the first
> time, thus the path delimiters are \ instead of /. 

Perl will let you use / for path separators on MS-Windows.

> For some
> reason the following very simple code will not compile:
> 
> $path = 'c:\home\mysite\cgi-bin\';
> $site = 'mysite';

From 'perldoc perlop', quote and quote-like operators:

q/STRING/
'STRING'
    A single-quoted, literal string. A backslash represents a
    backslash unless followed by the delimiter or another backslash,
    in which case the delimiter or backslash is interpolated.

The "unless followed by the delimiter" is what is biting you.

> The problem seems to be the trailing \ on line 1, but that is
> needed as part of the path so I can't leave it out.
> 
> Any ideas?

You could escape the backslash;  as it is you're escaping the single-
quote.

    $path = 'c:\home\mysite\cgi-bin\\';

Better yet, use forward slashes:

    $path = 'c:/home/mysite/cgi-bin/';


-- 
David Wall


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

Date: Thu, 14 Aug 2003 10:51:34 -0400
From: Marshall Dudley <mdudley@execonn.com>
Subject: Re: Quoting (was 'Bug in perl?')
Message-Id: <3F3BA1F6.16C44A46@execonn.com>

Thanks, I will use forward slashes. Dang I hate Windows.

Marshall

"David K. Wall" wrote:

> It's not a bug.
>
> Marshall Dudley <mdudley@execonn.com> wrote:
>
> > Perl 5.005_03 built for 386 freeBSD
>
> freeBSD doesn't sound very Windows-ish.  :-)

My system is FreeBSD, my customer's is Windows. I am working on the
script on my system, and ftping it up for their system to test after
verifying it compiles on my local system..

Marshall

>
>
> There are more recent versions of Perl, too.
>
> > I am trying to get perl to work on a windows system for the first
> > time, thus the path delimiters are \ instead of /.
>
> Perl will let you use / for path separators on MS-Windows.
>
> > For some
> > reason the following very simple code will not compile:
> >
> > $path = 'c:\home\mysite\cgi-bin\';
> > $site = 'mysite';
>
> From 'perldoc perlop', quote and quote-like operators:
>
> q/STRING/
> 'STRING'
>     A single-quoted, literal string. A backslash represents a
>     backslash unless followed by the delimiter or another backslash,
>     in which case the delimiter or backslash is interpolated.
>
> The "unless followed by the delimiter" is what is biting you.
>
> > The problem seems to be the trailing \ on line 1, but that is
> > needed as part of the path so I can't leave it out.
> >
> > Any ideas?
>
> You could escape the backslash;  as it is you're escaping the single-
> quote.
>
>     $path = 'c:\home\mysite\cgi-bin\\';
>
> Better yet, use forward slashes:
>
>     $path = 'c:/home/mysite/cgi-bin/';
>
> --
> David Wall



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

Date: Thu, 14 Aug 2003 16:08:35 GMT
From: "Ian.H [dS]" <ian@WINDOZEdigiserv.net>
Subject: Re: Quoting (was 'Bug in perl?')
Message-Id: <20030814170837.0923e1a2.ian@WINDOZEdigiserv.net>

On Thu, 14 Aug 2003 15:39:36 -0000 in
<message-id:Xns93D7769D0D63Bdkwwashere@216.168.3.30>
"David K. Wall" <usenet@dwall.fastmail.fm> wrote:

>  > I am trying to get perl to work on a windows system for the first
>  > time, thus the path delimiters are \ instead of /. 
> 
>  Perl will let you use / for path separators on MS-Windows.


/ as a separator is also vaid outside of Perl.. FWIW =)



Regards,

  Ian

-- 
Ian.H [Design & Development]
digiServ Network - Web solutions
www.digiserv.net | irc.digiserv.net | forum.digiserv.net
Programming, Web design, development & hosting.


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

Date: Thu, 14 Aug 2003 07:44:03 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: replace space only within quotes with something else
Message-Id: <slrnbjn10j.748.tadmc@magna.augustmail.com>

Sunil <sunil_franklin@hotmail.com> wrote:
> "Tad McClellan" <tadmc@augustmail.com> wrote in message
> news:slrnbjki2i.3jt.tadmc@magna.augustmail.com...
>> Sunil <sunil_franklin@hotmail.com> wrote:
>>
>>
>> > change all occurrences of space with some other characters, only if they
> are
>> > within double quotes


>     Sorry, this goes over my head can you give a complete example of how to
> change the value in $str  if
>             $str = 'this is my string';


No I cannot, because that string does not have text within double quotes,
so nothing is _supposed_ to be changed...


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


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

Date: Thu, 14 Aug 2003 08:23:55 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Simple tr/// script
Message-Id: <slrnbjn3bb.78t.tadmc@magna.augustmail.com>

Mike Flannigan <mikeflan@earthlink.net> wrote:
> 
> Abigail wrote:
> 
>>     while (<DATA>) {
>>         tr /a-zA-Z/n-za-mN-ZA-M/;
>>         print;
>>     }
>>
>> Abigail
> 
> That is so cool.


Yeah, now you'll be able to read those dirty/offensive jokes.  :-)


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


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

Date: Thu, 14 Aug 2003 17:24:21 GMT
From: Christopher Shatto <l0g0m0tion@earthlink.net>
Subject: Re: Simple tr/// script
Message-Id: <9BP_a.814$f15.89584@newsread1.prod.itd.earthlink.net>

Eric J. Roode wrote:

> 
> Or simply:
> 
>     @kites = <DATA>;
> 

Yep, that'll work too and it will even work fine in this instance.  I 
just try not to tell people to "slurp" things in an attempt to head off 
questions that inevitably arise in the vien of "I have a 52 trillion 
line file that I read with @foo = <$fh>; ... why do I have xyz problems 
with it?"  I personally would prefer Abigail's method later in this 
thread, but some people seem to have trouble remembering things like $_, 
@_, etc. My .02 anyhoo.



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

Date: Thu, 14 Aug 2003 23:31:49 +0800
From: "Pitt" <randy_chang@sohu.com>
Subject: strange error  "Unsuccessful stat on filename "
Message-Id: <bhg9k1$28an$1@mail.cn99.com>

Hi,
I get such a error
Unsuccessful stat on filename containing newline at
/usr/local/lib/perl5/5.8.0/ExtUtils/MM_Unix.pm line 2775

when i install a module .

I use HP-UX  IA64
i wouder does the file  MM_Unix.pm  contains some characters which the HP-UX
does not recognise or Perl in HP-UX
does not know.




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

Date: Thu, 14 Aug 2003 17:15:25 GMT
From: "Michael P. Broida" <michael.p.broida@boeing.com>
Subject: Re: strange error  "Unsuccessful stat on filename "
Message-Id: <3F3BC3AD.83EFFB6E@boeing.com>

Pitt wrote:
> 
> Hi,
> I get such a error
> Unsuccessful stat on filename containing newline at
> /usr/local/lib/perl5/5.8.0/ExtUtils/MM_Unix.pm line 2775
> 
> when i install a module .
> 
> I use HP-UX  IA64
> i wouder does the file  MM_Unix.pm  contains some characters which the HP-UX
> does not recognise or Perl in HP-UX
> does not know.

	Based solely on the error message (don't have Unix
	system to verify), I think this::

	MM_Unix.pm line 2775 is the line of Perl code that
	was executing when it found a newline in a DATA ITEM
	being passed to "stat" as a filename.  The message
	does NOT indicate anything wrong in MM_Unix.pm.

	You need to see just what that data item was that
	was being passed to "stat" as a filename.  It's
	probably a string that didn't get "chomp"ed.

	Again, I don't have a Unix system to verify this on,
	but it makes sense to me from the wording of the
	error message.

		Mike


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

Date: Thu, 14 Aug 2003 14:42:39 GMT
From: Uri Guttman <uri@stemsystems.com>
Subject: Re: Suggestions for further perl reading
Message-Id: <x7r83o1esh.fsf@mail.sysarch.com>

>>>>> "GS" == Gunter Schelfhout <nospam@please.com> writes:

  GS> Chad wrote:
  >> Ok I have finished the Llama book and am now creating simple scripts.
  >> 
  >> My question is what should I read to further myself at this.  is the
  >> camel book the way to go or is there something better?
  >> 
  >> One of my goals(among many) is to be able to streamline my code
  >> better(what takes me a whole screen would probably take you about 3
  >> lines).

  GS> Well, I only go to the Amazon site for the reviews. 
  GS> If I see a book that I'm interested in, I go trough these reviews. 
  GS> It can give you a good clue wether the book is right for you.

amazon reviews can be very useless as they are by anyone who can post a
review. they are not all qualified to tell if a book is well written and
edited, bug free, covers the right material, etc. i am not saying don't
use amazon reviews but rather don't use it exclusively and don't give it
too strong a weighting in your decision process.

the best way to buy tech books is to ask about them from people who are
respected in that field. amazon doesn't rank the background of each of
the reviewers which defeats that concept.

also the new site books.perl.org has info on most perl books with some
review information. at some point the site will have a distinction
between reader and expert reviewers and that will make a big
difference. 

uri

-- 
Uri Guttman  ------  uri@stemsystems.com  -------- http://www.stemsystems.com
--Perl Consulting, Stem Development, Systems Architecture, Design and Coding-
Search or Offer Perl Jobs  ----------------------------  http://jobs.perl.org


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

Date: Thu, 14 Aug 2003 08:02:20 -0500
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: using Getopt::Long with option value having spaces
Message-Id: <slrnbjn22s.748.tadmc@magna.augustmail.com>

Sunil <sunil_franklin@hotmail.com> wrote:

> I need to read this file line by line and parse it to get the values of
> frwk, -mode and comments,


-----------------------------------------
#!/usr/bin/perl
use strict;
use warnings;

while ( <DATA> ) {
   chomp;
#   my( $frwk, $mode, undef, $comments ) = /-\w+=(.*?)\s*(?=-\w+=|$)/g;
   my( $frwk, $mode, undef, $comments ) = / -\w+=
                                            (.*?)\s*
                                            (?=-\w+=|$)
                                          /xg;
   print "frwk '$frwk'  mode '$mode'  comments '$comments'\n";
}


__DATA__
t1.pl  -frwk=perl  -mode=1 -args=a,b,c  -comments="This is comment 1"
t2.sql  -frwk=sql -mode=2 -args=x -comments="This is comment 2"
-----------------------------------------


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


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

Date: Thu, 14 Aug 2003 18:01:01 GMT
From: Bart Lateur <bart.lateur@pandora.be>
Subject: Re: using Getopt::Long with option value having spaces
Message-Id: <rhjnjvoagioo7b4eagg4306tmo1i0prib1@4ax.com>

Alan J. Flavell wrote:

>I'm sure you realise that they're generated by software.
>
>It would presumably need a bit more craft to build a short form
>of the fragment name, and to ensure that it's unique within the
>document.  I'm sure it's do-able, but who's going to volunteer to
>implement it?

Just a counter will do, perhaps with a letter as prefix, as these are
the only anchors in the entire document.

-- 
	Bart.


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

Date: Sat, 19 Jul 2003 01:59:56 GMT
From: Bob Walton <bwalton@rochester.rr.com>
Subject: Re: 
Message-Id: <3F18A600.3040306@rochester.rr.com>

Ron wrote:

> Tried this code get a server 500 error.
> 
> Anyone know what's wrong with it?
> 
> if $DayName eq "Select a Day" or $RouteName eq "Select A Route") {

(---^


>     dienice("Please use the back button on your browser to fill out the Day
> & Route fields.");
> }
 ...
> Ron

 ...
-- 
Bob Walton



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

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.  

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 V10 Issue 5360
***************************************


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