[25757] in Perl-Users-Digest
Perl-Users Digest, Issue: 7996 Volume: 10
daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Wed Apr 20 14:05:26 2005
Date: Wed, 20 Apr 2005 11:05:08 -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 Wed, 20 Apr 2005 Volume: 10 Number: 7996
Today's topics:
Re: hotmail password request tool (intranet usage) <void@nowhere.lan>
Re: hotmail password request tool (intranet usage) <u.hobelmann@web.de>
Re: hotmail password request tool (intranet usage) <void@nowhere.lan>
How to call the remains of a pattern match <jure.simsic@mobitel.si>
Re: How to call the remains of a pattern match <jgibson@mail.arc.nasa.gov>
Re: How to call the remains of a pattern match <mark.clementsREMOVETHIS@wanadoo.fr>
Re: How to call the remains of a pattern match <tadmc@augustmail.com>
Re: Perl + Dreamweaver? <pilkowsk@informatik.uni-marburg.de>
Re: Perl XML parsing <citius21j@yahoo.com>
Re: Perl XML parsing <jgibson@mail.arc.nasa.gov>
Re: Problem with multiple instances of a module (Anno Siegel)
regex showdown <smcbutler@hotmail.com>
Re: regex showdown <phaylon@dunkelheit.at>
Re: regex showdown <mark.clementsREMOVETHIS@wanadoo.fr>
regular expression meaning (nicolas-laurent)
Re: regular expression meaning <noreply@gunnar.cc>
Re: regular expression meaning <tadmc@augustmail.com>
Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)
----------------------------------------------------------------------
Date: Wed, 20 Apr 2005 16:51:07 GMT
From: Leythos <void@nowhere.lan>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <%Lv9e.6659$0V2.5924@tornado.ohiordc.rr.com>
On Wed, 20 Apr 2005 08:25:10 -0500, Ulrich Hobelmann wrote:
>
> peter pilsl wrote:
>> Deleting executable attachemnts and unscannable zips from the mail is
>> done in most of the companies I sysadmin. Some Users still click on
>> everything that has a icon and a promising name.
>> MS-click-me-advertising has done some braindamager to the weaker
>> minded.
>
> How about the admins doing their job instead of deleting stuff in users'
> email? Like choosing a secure OS in the first place that runs the
> productivity apps the user needs, or running a solid backup-policy (when
> a stupid user fries his directory, boss screams at him for a while, but
> data can be restored), or running stuff in a sandbox (well, on Windows
> that probably means that you ONLY fry your own directory).
That was really lame. While I run both Linux and Windows workstations I
still see threats for Linux and Windows, neither OS is secure, it's all in
knowing how to lock each down.
Installing av software and or a firewall policy that blocks malicious
attachments from gaining access to company resources is part of an admins
job, at least in every government, commercial and private company I've
worked for or designed the networks for.
I've been running many platforms since the 70's and never experienced a
virus or compromised system on any network I've managed or designed,
including Windows based networks/systems, so it would seem that security
is not really an issue for the Windows platforms, it's more a problem
when you have ignorant administrators or ones that pretend to know about
security.
--
spam999free@rrohio.com
remove 999 in order to email me
------------------------------
Date: Wed, 20 Apr 2005 12:04:11 -0500
From: Ulrich Hobelmann <u.hobelmann@web.de>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <3cngcaF6o1q41U1@individual.net>
Leythos wrote:
> That was really lame. While I run both Linux and Windows workstations I
> still see threats for Linux and Windows, neither OS is secure, it's all in
> knowing how to lock each down.
Then pick BSD. Anyway, with a Firewall I doubt that Linux can
really be infected. Updates are usually painless too.
> Installing av software and or a firewall policy that blocks malicious
> attachments from gaining access to company resources is part of an admins
> job, at least in every government, commercial and private company I've
> worked for or designed the networks for.
Blocking infected attachments is relatively ok, unless you are
company that has an interest in sending viruses per mail (like an
AV company).
Just deleting all zips (or encrypted ones) is bloody stupid though.
> I've been running many platforms since the 70's and never experienced a
> virus or compromised system on any network I've managed or designed,
> including Windows based networks/systems, so it would seem that security
> is not really an issue for the Windows platforms, it's more a problem
> when you have ignorant administrators or ones that pretend to know about
> security.
From this thread I gathered that the problem seems to be not the
security (stuff sent with email is just passive files!), but
rather the dumb user that has to push the button on every bomb he
finds.
--
No man is good enough to govern another man without that other's
consent. -- Abraham Lincoln
------------------------------
Date: Wed, 20 Apr 2005 17:56:23 GMT
From: Leythos <void@nowhere.lan>
Subject: Re: hotmail password request tool (intranet usage)
Message-Id: <bJw9e.6663$0V2.5015@tornado.ohiordc.rr.com>
On Wed, 20 Apr 2005 12:04:11 -0500, Ulrich Hobelmann wrote:
>
> Leythos wrote:
>> That was really lame. While I run both Linux and Windows workstations I
>> still see threats for Linux and Windows, neither OS is secure, it's all
>> in knowing how to lock each down.
>
> Then pick BSD. Anyway, with a Firewall I doubt that Linux can really be
> infected. Updates are usually painless too.
Why BSD, by Windows XP and 2000/2003 servers are secure, I don't need to
move from RH FC3 or 2000/2003 servers to maintain a secure platform.
>> Installing av software and or a firewall policy that blocks malicious
>> attachments from gaining access to company resources is part of an
>> admins job, at least in every government, commercial and private
>> company I've worked for or designed the networks for.
>
> Blocking infected attachments is relatively ok, unless you are company
> that has an interest in sending viruses per mail (like an AV company).
Actually, many home users and open-relays spread viruses, not to mention
the compromised machines that spam hundreds of infected emails per minute
to random hosts.
> Just deleting all zips (or encrypted ones) is bloody stupid though.
Deleting any Zip file that is unscannable is a very good method. If you
need to move data between secure locations, using a Zip file is a sloppy
means of doing it. I suppose you've not seen the passworded zip files
where the lamer includes a note stating that the file has been passworded
for their protection.....
If you need encryption for moving data, you cans setup a VPN or secure FTP
server, those are better methods.
>> I've been running many platforms since the 70's and never experienced a
>> virus or compromised system on any network I've managed or designed,
>> including Windows based networks/systems, so it would seem that
>> security is not really an issue for the Windows platforms, it's more a
>> problem when you have ignorant administrators or ones that pretend to
>> know about security.
>
> From this thread I gathered that the problem seems to be not the
> security (stuff sent with email is just passive files!), but rather the
> dumb user that has to push the button on every bomb he finds.
Actually, it's ANY user. I've seen CIO's bring in infected laptops,
infected spread-sheets. I've seen companies allow contractors to connect
to the protected network without first validating the contractors laptop.
I've seen all sorts of bad things, and it makes it very hard to identify
which user will be a ignorant one vs a good one.
In the early days, and on unpatched Linux and Windows (and OS/X) systems
you could force execution without the user knowing about it my exploiting
a service. You could also exploit weaknesses in browsers and email
clients.
--
spam999free@rrohio.com
remove 999 in order to email me
------------------------------
Date: Wed, 20 Apr 2005 16:37:57 GMT
From: "Jure Simsic" <jure.simsic@mobitel.si>
Subject: How to call the remains of a pattern match
Message-Id: <Fzv9e.11590$F6.2306405@news.siol.net>
Let's say I have code like this:
$a="a:1 b:3 c:foo d:4";
while ($a =~ m/(\w):(\w+)/g){
# do stuff with $1 and $2
if ($2 eq "foo"){
&sub( ${what's left of $a} )
}
}
One way that I can think of is
$a =~ s/^.*$2//;
before calling &sub($a), but that seems awkward..
Is there any nicer way to achieve this?
Tnx
Jure
------------------------------
Date: Wed, 20 Apr 2005 10:08:31 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: How to call the remains of a pattern match
Message-Id: <200420051008317491%jgibson@mail.arc.nasa.gov>
In article <Fzv9e.11590$F6.2306405@news.siol.net>, Jure Simsic
<jure.simsic@mobitel.si> wrote:
> Let's say I have code like this:
>
> $a="a:1 b:3 c:foo d:4";
>
> while ($a =~ m/(\w):(\w+)/g){
> # do stuff with $1 and $2
> if ($2 eq "foo"){
> &sub( ${what's left of $a} )
> }
> }
>
> One way that I can think of is
> $a =~ s/^.*$2//;
> before calling &sub($a), but that seems awkward..
>
> Is there any nicer way to achieve this?
Sure. If you are in hurry, just use the $' special variable. If your
_program_ is in a hurry, use the substr and pos functions:
&sub(substr($a,pos $a))
Other notes:
1. $a is a special variable and should not be used as one of your
variables.
2. There is no need to put ampersand (&) in front of function call.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: Wed, 20 Apr 2005 19:08:52 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: How to call the remains of a pattern match
Message-Id: <42668ca4$0$25046$8fcfb975@news.wanadoo.fr>
Jure Simsic wrote:
> Let's say I have code like this:
>
> $a="a:1 b:3 c:foo d:4";
>
> while ($a =~ m/(\w):(\w+)/g){
> # do stuff with $1 and $2
> if ($2 eq "foo"){
> &sub( ${what's left of $a} )
> }
> }
>
> One way that I can think of is
> $a =~ s/^.*$2//;
> before calling &sub($a), but that seems awkward..
>
> Is there any nicer way to achieve this?
>
> Tnx
> Jure
Use pos and substr.
bob 1297 $ cat testre.pl
use strict;
use warnings;
my $testString = shift;
while($testString=~/(.)/g){
my $lastPos = pos $testString;
my $remainder = substr($testString,$lastPos);
print "$1 => $remainder\n";
}
bob 1298 $ perl testre.pl mark
m => ark
a => rk
r => k
k =>
You could use $' (look for POSTMATCH in man perlre, but this imposes a
performance penalty).
Mark
------------------------------
Date: Wed, 20 Apr 2005 12:25:20 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: How to call the remains of a pattern match
Message-Id: <slrnd6d440.56m.tadmc@magna.augustmail.com>
Jure Simsic <jure.simsic@mobitel.si> wrote:
> $a="a:1 b:3 c:foo d:4";
>
> while ($a =~ m/(\w):(\w+)/g){
while ($a =~ s/^(\w):(\w+)\s*// ){
> # do stuff with $1 and $2
> if ($2 eq "foo"){
&sub( $a )
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
Date: Wed, 20 Apr 2005 19:11:39 +0200
From: Fabian Pilkowski <pilkowsk@informatik.uni-marburg.de>
Subject: Re: Perl + Dreamweaver?
Message-Id: <3cngpvF6o3cq4U1@individual.net>
* Nikos schrieb:
> Fabian Pilkowski wrote:
>
>> Err, I meant the header of your posting here, not the header generated
>> by your script ;-)
>
> You mean that i shouls set my newsclient reader to send posts away with
> the Greek char set instead of the english one?
Just if it contains such Greek data inside.
>
> But what if my post has Greek and English inside it? :)
That's no problem since all english chars are in each iso-8859-x charset
(the first 128 chars) and only the ones from 129 upwards will differ.
But now, your posting is encoded in utf-8, so there's no trouble with
your Greek characters ;-)
>
>> I see, it's hard to do anything with that HTML code produced by CGI.pm.
>> But, and that could help you a lot, there's a module named CGI::Pretty,
>> a subclass of CGI.pm. Try to replace »use CGI« with »use CGI::Pretty«
>> and look at your HTML code afterwards. It might be a bit smoother.
>
> Thanks ill try it to do it right away.
> I think thought that it would be more easier to donwload Dreamweaver MX
> and create the webpage from scratch and then use the templatin system
> HTML::Template to insert values in the right places of the Dreamweaver's
> html output?
>
> What do you think? Byhand or by Dreamweaver?
> Also with DW i would be able to create more fancy stuff that i could do
> with handcoded html.
Have you read the posting from "johnh" in this thread. He's pointing out
that you can use Dreamweaver to generate your templates and its special
tags. Therefore, I would try that way -- since you're using Dreamweaver
already.
Whether to create your templates from scratch or by changing your old
pages generated by CGI.pm -- I couldn't help you to decide. It's your
part to check out which one is the right for you.
>
> Also in my the html output i have this:
>
> <option value="ёнб мЮнхмб уе ьлпхт фпхт Ьрйуфпхт">ёнб мЮнхмб уе ьлпхт
> фпхт Ьрйуфпхт</option>
> <option value="Бгйпт ЙщЬннзт п Дбмбукзньт -- РесЯ Рбиюн">Бгйпт ЙщЬннзт п
> Дбмбукзньт -- РесЯ Рбиюн</option>
>
> Dont bother about the Greek. I copy pasted from the editor here but i
> dont know why it looks so funny.
Yes, your posting is encoded correctly, so I can see the Greek ;-)
>
> The above html output is produced by this perl code:
>
> print p( {-align=>'center'}, font( {-size=>5, -color=>'Lime'},
> 'Ëüãïò Øõ÷ùöåëÞò êáé ÈáõìÜóéïò => ' ),
> popup_menu( -name=>'select', -values=>\@display_files ),
> submit('ok'));
>
> If i try to replace the values in the html with tmpl_var name=something
> what must i insert and how?
Please consider to have a closer look to the docs shipped with the
module. There exists a template tag <tmpl_loop> which is exactly what
you need for such things. Therewith, you have to pass an arrayref to the
param() method to fill in your template.
regards,
fabian
------------------------------
Date: 20 Apr 2005 09:28:40 -0700
From: "citius21j@yahoo.com" <citius21j@yahoo.com>
Subject: Re: Perl XML parsing
Message-Id: <1114014520.703786.232370@z14g2000cwz.googlegroups.com>
>You may be getting multiple calls to char_handler, save the data from
char_handler, appending the data passed in
each call to a global variable. In end_handler, print the element name,
data, and then clear the data global variable.
When I follow this approach, Multiple calls to char_handler is
eleminated but as it is reading ElementTypes from end handler, the
parent element type is displayed after the child. Which is not how I
want the output displayed.
Also, data from "<![CDATA[ " is not captured.
Could someone please guide me how to parse xml data using the
XML::Parser to display the parent element type followed by the
attribute and values and then the child element.
I apologize for not having posted a proper followup before.
------------------------------
Date: Wed, 20 Apr 2005 10:30:10 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Perl XML parsing
Message-Id: <200420051030105450%jgibson@mail.arc.nasa.gov>
In article <1114014520.703786.232370@z14g2000cwz.googlegroups.com>,
<"citius21j@yahoo.com"> wrote:
> >You may be getting multiple calls to char_handler, save the data from
> char_handler, appending the data passed in
> each call to a global variable. In end_handler, print the element name,
>
> data, and then clear the data global variable.
Please give attribution when you include text written by others. The
above was written by somebody else (me), not you.
>
> When I follow this approach, Multiple calls to char_handler is
> eleminated but as it is reading ElementTypes from end handler, the
> parent element type is displayed after the child. Which is not how I
> want the output displayed.
> Also, data from "<![CDATA[ " is not captured.
The multiple calls to char_handler are still happening. Please read the
documentation for modules you use:
From XML::Parser description on CPAN:
"A single non-markup sequence of characters may generate multiple calls
to this handler."
Try adding CdataStart and CdataEnd handlers if you want to process
CDATA.
>
> Could someone please guide me how to parse xml data using the
> XML::Parser to display the parent element type followed by the
> attribute and values and then the child element.
XML::Parser is a SAX-type parser: it generates callbacks to handler
functions as entities are encountered as the XML is scanned
sequentially. If you do not like to print data as those events occur,
then you must save data from the XML and print it after the parsing is
complete. In that case you would be better off using a DOM-type XML
parser, which saves all of the XML data in a data structure. This is
what XML::Simple does. If you can't use another parser, then you are
going to have to write your own DOM-like parser using XML::Parser and
save the XML data in your own data structure and print out what you
want at the end.
----== Posted via Newsfeeds.Com - Unlimited-Uncensored-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
------------------------------
Date: 20 Apr 2005 15:32:31 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Problem with multiple instances of a module
Message-Id: <d45smf$eok$1@mamenchi.zrz.TU-Berlin.DE>
Kim H. Jensen <devnull@post4.tele.dk> wrote in comp.lang.perl.misc:
> Hi, i thought i had this OO thing figured out, but apparantly not.
>
> I have a module i want to make multiple instances of
>
> All goes well with the first instance until i create a second instance,
> then the first instance seems to be overwritten.
>
> I have made a small test module to demonstrate the problem
> --------------------------------------------
> # perl module Testobject.pm
> package Testobject;
>
> sub new
> {
> my $class=shift;
> my $self={};
> $self{'id'}=shift;
> bless ($self, $class);
> print "New $self{'id'} - Self: $self\n";
> return $self;
> }
>
>
> sub showid
> {
> my $self=shift;
> my $caller=shift;
> print "ID: $self{'id'} - Caller: $caller - Self: $self\n";
> }
>
>
> sub DESTROY
> {
> print "Bye-bye $self{'id'}\n";
> }
>
> 1;
> --------------------------------------------
>
>
> And a small test program
> --------------------------------------------
> #!/usr/bin/perl -w
>
> use Testobject;
>
> $inst_1=Testobject->new("Inst-1");
> $inst_1->showid("Inst_1");
>
> $inst_2=Testobject->new("Inst-2");
> $inst_1->showid("Inst_1");
> $inst_2->showid("Inst_2");
>
> undef($inst_2);
> $inst_1->showid("Inst_1");
> --------------------------------------------
>
>
> When i run the program it outputs:
> --------------------------------------------
> New Inst-1 - Self: Testobject=HASH(0x2850e0)
> ID: Inst-1 - Caller: Inst_1 - Self: Testobject=HASH(0x2850e0)
> New Inst-2 - Self: Testobject=HASH(0x2851a0)
> ID: Inst-2 - Caller: Inst_1 - Self: Testobject=HASH(0x2850e0)
> ID: Inst-2 - Caller: Inst_2 - Self: Testobject=HASH(0x2851a0)
> Bye-bye Inst-2
> ID: Inst-2 - Caller: Inst_1 - Self: Testobject=HASH(0x2850e0)
> Bye-bye Inst-2
> --------------------------------------------
>
> When instance 2 is created, instance 1 takes on the identity of instance 2.
>
> What have i overlooked?
You are not using strict, which allows you to use package variables
by mistake. Also, you are trying to access a hashref like a hash
"$hashref{ key}" when you should use "$hashref->{ key}".
Add "use strict" and see for yourself. You'll notice that some of your
variables aren't what you think they are. I believe you'll be able to
fix the program with the help of the messages you'll see.
Anno
------------------------------
Date: 20 Apr 2005 10:07:56 -0700
From: "si" <smcbutler@hotmail.com>
Subject: regex showdown
Message-Id: <1114016875.968930.13450@o13g2000cwo.googlegroups.com>
hi, i have a regex question for the gurus here
str = "aa (b c d) ee ff=1.7e-006 gg=4.1 hh=1 ii=on"
notes:
- the string between the parenthesis can be any length,
eg:( b c d b1 c1 d1 b2 c2 etc.... )
- there can be any number of name=value pairs at the end of the
expression
eg: ff=1.7e-006 gg=4.1 hh=1 ii=on jj=2.5 kk=connected etc
what would be regex that would return the below?
$name = 'aa'
@friends = ('b', 'c', 'd')
$alias = 'ee'
%pairs = ( 'ff', 1.7e-006,
'gg', 4.1,
'hh', 1, etc .. )
thx thx thx!
------------------------------
Date: Wed, 20 Apr 2005 19:29:15 +0200
From: phaylon <phaylon@dunkelheit.at>
Subject: Re: regex showdown
Message-Id: <pan.2005.04.20.17.29.15.933708@dunkelheit.at>
si wrote:
> what would be regex that would return the below?
What have you tried? I'm always interested in getting better, but that
doesn't mean that I'm gonna do other people's jobs.
--
http://www.dunkelheit.at/
Better to reign in hell than to serve in heaven
-- John Milton, Paradise Lost
------------------------------
Date: Wed, 20 Apr 2005 19:42:24 +0200
From: Mark Clements <mark.clementsREMOVETHIS@wanadoo.fr>
Subject: Re: regex showdown
Message-Id: <42669481$0$847$8fcfb975@news.wanadoo.fr>
si wrote:
> hi, i have a regex question for the gurus here
>
> str = "aa (b c d) ee ff=1.7e-006 gg=4.1 hh=1 ii=on"
>
> notes:
> - the string between the parenthesis can be any length,
> eg:( b c d b1 c1 d1 b2 c2 etc.... )
> - there can be any number of name=value pairs at the end of the
> expression
> eg: ff=1.7e-006 gg=4.1 hh=1 ii=on jj=2.5 kk=connected etc
>
>
> what would be regex that would return the below?
>
> $name = 'aa'
>
> @friends = ('b', 'c', 'd')
>
> $alias = 'ee'
>
> %pairs = ( 'ff', 1.7e-006,
> 'gg', 4.1,
> 'hh', 1, etc .. )
>
Break the problem into chunks: you might be able to do most of it in one
go, but it would be nearly impossible to maintain.
Hint: your test string has four distinct parts. Take it from there.
Other here posters could easily provide you with a regex to do this
first step (which is the meat of the problem), but as has been pointed
out, you don't appear to have tried anything yet and this place is
supposed to be for asking advice, not for asking others to do your work.
Mark
------------------------------
Date: 20 Apr 2005 08:43:01 -0700
From: nicolas_laurent545@hotmail.com (nicolas-laurent)
Subject: regular expression meaning
Message-Id: <97fc9ebc.0504200743.7677ce27@posting.google.com>
Could you explain to me what this regular expression means
=~ m,([^;]+);([^\n]+)\n?,g) {
sub build_rules {
my $src = get_file_content($rules_spec);
my %rules;
while ($src =~ m,([^;]+);([^\n]+)\n?,g) {
$rules{$1} = $2;
}
return \%rules
}
------------------------------
Date: Wed, 20 Apr 2005 17:53:52 +0200
From: Gunnar Hjalmarsson <noreply@gunnar.cc>
Subject: Re: regular expression meaning
Message-Id: <3cnc94F6oq5a0U1@individual.net>
nicolas-laurent wrote:
> Could you explain to me what this regular expression means
>
> =~ m,([^;]+);([^\n]+)\n?,g) {
>
>
> sub build_rules {
> my $src = get_file_content($rules_spec);
> my %rules;
> while ($src =~ m,([^;]+);([^\n]+)\n?,g) {
> $rules{$1} = $2;
> }
> return \%rules
> }
The function parses a string like "rule1;abc\nrule2;def\nrule3;ghi" and
assigns the rule/value pairs to a hash.
perldoc perlrequick
perldoc perlretut
perldoc perlre
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
------------------------------
Date: Wed, 20 Apr 2005 12:32:10 -0500
From: Tad McClellan <tadmc@augustmail.com>
Subject: Re: regular expression meaning
Message-Id: <slrnd6d4gq.56m.tadmc@magna.augustmail.com>
nicolas-laurent <nicolas_laurent545@hotmail.com> wrote:
> Could you explain to me what this regular expression means
>
> =~ m,([^;]+);([^\n]+)\n?,g) {
^^ ^^^
^^ ^^^
The underlined parts are NOT part of a regular expression.
m,([^;]+) # any chars that are not semicolon
; # required semicolon
([^\n]+) # any chars that are not newline
\n? # optional newline
,gx
ie. Grab 2 chunks of text separated by a semicolon.
It seems a hokey regexification of a vanilla split():
split /;/, $somevar, 2;
Where did you come across that code?
--
Tad McClellan SGML consulting
tadmc@augustmail.com Perl programming
Fort Worth, Texas
------------------------------
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 V10 Issue 7996
***************************************