[29403] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 647 Volume: 11

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Thu Jul 12 16:10:18 2007

Date: Thu, 12 Jul 2007 13:09:07 -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, 12 Jul 2007     Volume: 11 Number: 647

Today's topics:
    Re: [OT] stopping spam with JavaScript <rvtol+news@isolution.nl>
    Re: Capturing a Repeated Group <perrog@gmail.com>
    Re: Capturing a Repeated Group <mritty@gmail.com>
    Re: Capturing a Repeated Group anno4000@radom.zrz.tu-berlin.de
    Re: Capturing a Repeated Group <perrog@gmail.com>
    Re: Capturing a Repeated Group <rvtol+news@isolution.nl>
    Re: Difficulty manipulating hashes <jgibson@mail.arc.nasa.gov>
    Re: How to undo a bless on a GLOB <yshtil@cisco.com>
    Re: How to undo a bless on a GLOB anno4000@radom.zrz.tu-berlin.de
    Re: Perl 5.6 vs 5.8 <mritty@gmail.com>
    Re: Perl 5.6 vs 5.8 <sigzero@gmail.com>
    Re: Perl programming needed <dha@panix.com>
    Re: Portable general timestamp format, not 2038-limited <lew@lewscanon.nospam>
    Re: re-lurking <bik.mido@tiscalinet.it>
    Re: Using MsAccess with Perl on a UNIX system <vilain@spamcop.net>
    Re: Using MsAccess with Perl on a UNIX system <lambik@kieffer.nl>
    Re: Using xargs perl to join lines <savagebeaste@yahoo.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Thu, 12 Jul 2007 21:46:05 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: [OT] stopping spam with JavaScript
Message-Id: <f767nk.1ik.1@news.isolution.nl>

Dr.Ruud schreef:
> Michele Dondi:

>> Who's afraid of big bad JS anymore, nowadays?!?
> 
> New security breaches that are only possible by using your JavaScript
> enabled browser, pop-up every other week.

This week's: 
http://www.xs-sniper.com/sniperscope/IE-Pwns-Firefox.html 

(NoScript protects against this already since June 22) 

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Thu, 12 Jul 2007 06:32:51 -0700
From:  "perrog@gmail.com" <perrog@gmail.com>
Subject: Re: Capturing a Repeated Group
Message-Id: <1184247171.715870.107540@m3g2000hsh.googlegroups.com>


Thanks Xicheng, Hjalmarsson, Steven and Anno for your inputs!

I'm really "inchworming" my way through the string, scanning tokens
like a lexical analyzer. If it fails to scan numbers like
"1,234,567,890", it continue to scan identifier token (e.g. /\w+(\d|
\w)*/)

On 12 Juli, 00:55, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> Xicheng Jia wrote:
> > you probably want this:
>
> >    @parts = /(\d{1,3})(?=,(?:\d{3}))*/g  .....
>
> Let's see:
>
> C:\home>type test.pl
> use warnings;
> $_ = '1,234,567,890';
> @parts = /(\d{1,3})(?=,(?:\d{3}))*/g;
> print @parts, "\n";
>
> C:\home>test.pl
> (?=,(?:\d{3}))* matches null string many times in regex; marked by
> <-- HERE in m/(\d{1,3})(?=,(?:\d{3}))* <-- HERE / at C:\home\test.pl
> line 3.
> 1234567890
>

Even if perl reports matches null string many times, isn't this what I
want?
I want to match 123 or 1,234 or 1,234,567 or similar patterns.
Since the regexp starts with /\d{1,3}/ it never matches the null
string.
Can't see for what patterns this fails...?

Thanks for any hints!



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

Date: Thu, 12 Jul 2007 07:02:12 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Capturing a Repeated Group
Message-Id: <1184248932.608690.240900@w3g2000hsg.googlegroups.com>

On Jul 12, 8:59 am, "per...@gmail.com" <per...@gmail.com> wrote:
> The short answer is that I'm "inchworming" my way through the string.
> The text may contain senteces with commas, and is not a single number
> string. And after the number is matches, I continue with other
> matches.

Regexp::Common is your friend.

> Correct me if I'm wrong, but for my scenario I think substitutions
> requires two matches, first a hit, then a substitution, like so:
> $_ = "1,234,456,789";
> /\d{1,3}(?:,\d\d\d)*/g && do {
>   my $number= $&;
>   $number =~ s/,//g;
>   print "$number\n";
>
> }
>
> But if the number parts could be eaten up in one regexp, it is
> unnecessarily to use two. :-)

Unnecessary, maybe, but a heck of a lot more readable.

#!/opt2/perl/bin/perl
use strict;
use warnings;
use Regexp::Common qw/number/;

my @numbers;
while (<DATA>) {
    push @numbers, /$RE{num}{int}{-sep=>','}/g;
}
tr/,//d for @numbers;
print join(' - ', @numbers), "\n";

__DATA__
Lorem ipsum dolor sit amet, 1,234,567,890 consectetuer 1,000
lacinia risus. 56,650,231 Duis 432 porta vehicula 8,103 ligula.

$ ./nums.pl
1234567890 - 1000 - 56650231 - 432 - 8103

Paul Lalli




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

Date: 12 Jul 2007 14:20:11 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: Capturing a Repeated Group
Message-Id: <5fmrkrF35jjjfU1@mid.dfncis.de>

perrog@gmail.com <perrog@gmail.com> wrote in comp.lang.perl.misc:
> 
> Thanks Xicheng, Hjalmarsson, Steven and Anno for your inputs!
> 
> I'm really "inchworming" my way through the string, scanning tokens
> like a lexical analyzer. If it fails to scan numbers like
> "1,234,567,890", it continue to scan identifier token (e.g. /\w+(\d|
> \w)*/)

That sounds like you want a real parser, where number recognition
would be part of the general parsing process.

> On 12 Juli, 00:55, Gunnar Hjalmarsson <nore...@gunnar.cc> wrote:
> > Xicheng Jia wrote:
> > > you probably want this:
> >
> > >    @parts = /(\d{1,3})(?=,(?:\d{3}))*/g  .....
> >
> > Let's see:
> >
> > C:\home>type test.pl
> > use warnings;
> > $_ = '1,234,567,890';
> > @parts = /(\d{1,3})(?=,(?:\d{3}))*/g;
> > print @parts, "\n";
> >
> > C:\home>test.pl
> > (?=,(?:\d{3}))* matches null string many times in regex; marked by
> > <-- HERE in m/(\d{1,3})(?=,(?:\d{3}))* <-- HERE / at C:\home\test.pl
> > line 3.
> > 1234567890
> >
> 
> Even if perl reports matches null string many times, isn't this what I
> want?
> I want to match 123 or 1,234 or 1,234,567 or similar patterns.
> Since the regexp starts with /\d{1,3}/ it never matches the null
> string.
> Can't see for what patterns this fails...?

The pattern you're repeating is a *zero width* lookahead.  Whatever
the regex engine does internally to determine if it matches, the
width of the match will be zero.  That's what it's complaining about.
The asterisk does nothing, you can remove it.

Anno


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

Date: Thu, 12 Jul 2007 07:21:57 -0700
From:  "perrog@gmail.com" <perrog@gmail.com>
Subject: Re: Capturing a Repeated Group
Message-Id: <1184250117.413130.246650@m3g2000hsh.googlegroups.com>

On 12 Juli, 04:18, Xicheng Jia <xich...@gmail.com> wrote:
> On Jul 11, 11:09 pm, "attn.steven....@gmail.com"
>
> > The latter won't work for a target string like:
> > $_ = '123,456,789';
> > (i.e., anything with an odd number of comma delimited substrings).
> > You can try global match (//g) in scalar context:
> > $_ = "1,234,567,890";
>
> > my $n = 0;
> > while (/\G(\d{1,3})(?:,|$)/g)
>
> this should be the same as:
>
>    while (/\G(\d{1,3}),?/g)
>

Ohh, now I'm beginning to see the logic... :-) The /(\d{1,3})(?:,
(\d{3}))*/g rexexp captured repeated productions, not repeated groups.

So, to sum up. I can't use /(\d{1,3})(?:,(\d\d\d))*/ because the RE
engine only save captured repeated groups for the last iteration. The
fix is to use g-modifier to capture repeated productions... the
subject of this thread should really have been "capturing repeated
productions", right? :-)

Ideally, /(\d{1,3})|(?<=\d{1,3}),(\d\d\d)/g would work, but (?<=
\d{1,3}) is not implemented yet, so I ended up writing:

@parts = ();
(@parts =   grep { defined $_ }
            m((\d{1,3})
                # (?<=\d{1,3}) not implemented, use three cases
                | (?<=\d),(\d\d\d)
                | (?<=\d\d),(\d\d\d)
                | (?<=\d\d\d),(\d\d\d)
            )xg) && do {
    my $number = 0;
    $number = $number * 1000 + $_ foreach (@parts);
    print "$number\n";
};

It uses a "Schwartzian transformation" to filter out undef captures,
which I suppose comes from alternation cases.



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

Date: Thu, 12 Jul 2007 21:35:05 +0200
From: "Dr.Ruud" <rvtol+news@isolution.nl>
Subject: Re: Capturing a Repeated Group
Message-Id: <f766qt.198.1@news.isolution.nl>

perrog@gmail.com schreef:

> I want to match 123 or 1,234 or 1,234,567 or similar patterns.

  perldoc -f reverse

-- 
Affijn, Ruud

"Gewoon is een tijger."


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

Date: Thu, 12 Jul 2007 11:16:31 -0700
From: Jim Gibson <jgibson@mail.arc.nasa.gov>
Subject: Re: Difficulty manipulating hashes
Message-Id: <120720071116312549%jgibson@mail.arc.nasa.gov>

In article <3b-dnY2P6ZRQzwjbnZ2dnUVZ_vWtnZ2d@comcast.com>, merl the
perl <invalid@invalid.net> wrote:

> "Dr.Ruud" <rvtol+news@isolution.nl> wrote in message 
> news:f73ojo.12c.1@news.isolution.nl...
> > limitz schreef:
> >
> >> Here is my script, followed by my question at the end:
> I have a different question.  I don't know what a hash literal is.  In my 
> reference book, I can find out things about a hash, which apparently in perl 
> has nothing to do with the character that I call "hash:" #.  "Literal" is no 
> help in the index.  I'm thinking that a hash literal might be the spoken 
> version of something else, probably with more words, in the literature, and 
> seek comment on it.

See, for example, <http://en.wikipedia.org/wiki/Literal>:

"any notation for representing a value within programming language
source code; for example, an object literal, a string literal, a
function literal"

A "hash" in Perl is an associative array. A hash literal is a list
comprising an even number of scalar values. The odd-numbered scalars
are used for the keys, and the even-numbered ones for the values
associated with the preceding key. For example:

my %hash = ( 'key1', 'val1', 'key2', 'val2' );

It is customary to use '=>' between key and value, which allows you to
use barewords for the keys (and looks nicer):

my %hash = ( key1 => 'val1', key2 => 'val2' );

See 'perldoc perldata' for more info.

 Posted Via Usenet.com Premium Usenet Newsgroup Services
----------------------------------------------------------
    ** SPEED ** RETENTION ** COMPLETION ** ANONYMITY **
----------------------------------------------------------        
                http://www.usenet.com


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

Date: Thu, 12 Jul 2007 08:57:07 -0700
From: Yuri Shtil <yshtil@cisco.com>
Subject: Re: How to undo a bless on a GLOB
Message-Id: <1184255813.661172@sj-nntpcache-2.cisco.com>

anno4000@radom.zrz.tu-berlin.de wrote:
> Yuri Shtil  <yshtil@cisco.com> wrote in comp.lang.perl.misc:
>> The scenario is like this:
>> A GLOB was created via Symbol::gensym:
>>
>> use Symbol
>> my $foo = gensym();
>>
>> The reference was blessed to something:
>>
>> bless $foo, 'Something';
>>
>> I need to be able to revert $foo back to the glob.
>>
>> How do I do it?
> 
> You can't.  Once an object is blessed, it can only be re-blessed
> into another class, not unblessed.  Can you bless the glob before
> POE gets hold of it?
> 
>> Detail:
>>
>> The reason for all this trouble is that a module with a garbage 
>> collector (POE) keeps track of $foo in a hash keyed by $foo itself, 
>> which is a stringified reference. When I bless it, the garbage collector 
>> cannot find the reference.
> 
> That could be a bug in POE.  It should key the hash with the refaddr
> of objects, not with the stringified object itself.  It would also
> fail if the object overloaded stringification.
> 
> Anno

Well, I patched POE (POE/Resource/FileHandle.pm to do exactly what you 
suggested since my code is broken otherwise. I keep my fingers crossed I 
did not break something else, but so far so good.

I wonder how to suggest a fix to the POE?


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

Date: 12 Jul 2007 17:11:13 GMT
From: anno4000@radom.zrz.tu-berlin.de
Subject: Re: How to undo a bless on a GLOB
Message-Id: <5fn5lhF37psluU1@mid.dfncis.de>

Yuri Shtil  <yshtil@cisco.com> wrote in comp.lang.perl.misc:
> anno4000@radom.zrz.tu-berlin.de wrote:
> > Yuri Shtil  <yshtil@cisco.com> wrote in comp.lang.perl.misc:
> >> The scenario is like this:
> >> A GLOB was created via Symbol::gensym:
> >>
> >> use Symbol
> >> my $foo = gensym();
> >>
> >> The reference was blessed to something:
> >>
> >> bless $foo, 'Something';
> >>
> >> I need to be able to revert $foo back to the glob.
> >>
> >> How do I do it?
> > 
> > You can't.  Once an object is blessed, it can only be re-blessed
> > into another class, not unblessed.  Can you bless the glob before
> > POE gets hold of it?
> > 
> >> Detail:
> >>
> >> The reason for all this trouble is that a module with a garbage 
> >> collector (POE) keeps track of $foo in a hash keyed by $foo itself, 
> >> which is a stringified reference. When I bless it, the garbage collector 
> >> cannot find the reference.
> > 
> > That could be a bug in POE.  It should key the hash with the refaddr
> > of objects, not with the stringified object itself.  It would also
> > fail if the object overloaded stringification.
> > 
> > Anno
> 
> Well, I patched POE (POE/Resource/FileHandle.pm to do exactly what you 
> suggested since my code is broken otherwise. I keep my fingers crossed I 
> did not break something else, but so far so good.
>
> I wonder how to suggest a fix to the POE?

Best in form of a patch.

    diff -udp .../orig/POE/Resource/FileHandle.pm \
        .../patched/POE/Resource/FileHandle.pm >PRF.patch

Mail it to the author of the specific module (POE has many authors),
with an explanation of what and why.  The author is usually noted at
the end of the documentation.

Anno


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

Date: Thu, 12 Jul 2007 07:05:07 -0700
From:  Paul Lalli <mritty@gmail.com>
Subject: Re: Perl 5.6 vs 5.8
Message-Id: <1184249107.888995.250190@w3g2000hsg.googlegroups.com>

On Jul 12, 8:36 am, Robert Hicks <sigz...@gmail.com> wrote:
> #!/opt/perl5/bin/perl
>

<snip an absurdly long program>

I asked you to post a SHORT but complete program, and to tell us what
messages are being "dropped" between Perl versions.

Paul Lalli



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

Date: Thu, 12 Jul 2007 11:56:36 -0700
From:  Robert Hicks <sigzero@gmail.com>
Subject: Re: Perl 5.6 vs 5.8
Message-Id: <1184266596.166706.240440@n2g2000hse.googlegroups.com>

On Jul 12, 10:05 am, Paul Lalli <mri...@gmail.com> wrote:
> On Jul 12, 8:36 am, Robert Hicks <sigz...@gmail.com> wrote:
>
> > #!/opt/perl5/bin/perl
>
> <snip an absurdly long program>
>
> I asked you to post a SHORT but complete program, and to tell us what
> messages are being "dropped" between Perl versions.
>
> Paul Lalli

Whoops...sorry. I was being overzealous.

Robert



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

Date: Thu, 12 Jul 2007 17:04:43 +0000 (UTC)
From: "David H. Adler" <dha@panix.com>
Subject: Re: Perl programming needed
Message-Id: <slrnf9cnpb.n08.dha@panix2.panix.com>

On 2007-07-08, jimejobob@thehodown.com <jimejobob@thehodown.com> wrote:
> This is what I need...

You have posted a job posting or a resume in a technical group.

Longstanding Usenet tradition dictates that such postings go into
groups with names that contain "jobs", like "misc.jobs.offered", not
technical discussion groups like the ones to which you posted.

Had you read and understood the Usenet user manual posted frequently to
"news.announce.newusers", you might have already known this. :)  (If
n.a.n is quieter than it should be, the relevent FAQs are available at
http://www.faqs.org/faqs/by-newsgroup/news/news.announce.newusers.html)
Another good source of information on how Usenet functions is
news.newusers.questions (information from which is also available at
http://www.geocities.com/nnqweb/).

Please do not explain your posting by saying "but I saw other job
postings here".  Just because one person jumps off a bridge, doesn't
mean everyone does.  Those postings are also in error, and I've
probably already notified them as well.

If you have questions about this policy, take it up with the news
administrators in the newsgroup news.admin.misc.

http://jobs.perl.org may be of more use to you

Yours for a better usenet,

dha

-- 
David H. Adler - <dha@panix.com> - http://www.panix.com/~dha/
He looked like Elvis '75 - Puffed up but still alive
	- The Merrymakers, "Superstar"


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

Date: Thu, 12 Jul 2007 10:16:20 -0400
From: Lew <lew@lewscanon.nospam>
Subject: Re: Portable general timestamp format, not 2038-limited
Message-Id: <1rGdnWBTvMgpqgvbnZ2dnUVZ_sLinZ2d@comcast.com>

Ben Finney wrote:
> [0] Left unqualified, referring to a site named "Wiki" refers to *the*
> Wiki, at <URL:http://c2.com/cgi/wiki>. If you mean some other
> subsequent Wiki site, you'll need to be more specific.

I'm betting they meant
<http://en.wikipedia.org/wiki/Main_Page>

or one of its non-English siblings.

-- 
Lew


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

Date: Thu, 12 Jul 2007 17:55:52 +0200
From: Michele Dondi <bik.mido@tiscalinet.it>
Subject: Re: re-lurking
Message-Id: <sljc93do6iv92hais7q42dovp2qbd1lb8q@4ax.com>

On Mon, 9 Jul 2007 02:52:46 -0400, "Wade Ward" <invalid@invalid.nyet>
wrote:

>Most of the numbers are similar, if not the same.  I didn't suspect, when I 
>threw in the towel, that the constructor was not syntactically correct.  I 

It was *syntactically* correct. *Semantically* wrong.

>did see something about the curly braces being wrong but did not know that 
>they were causing the constructor to take a dump.  Thanks for your help.

The curly braces may have been fine: many of Benchmark.pm's functions
work like that.


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: Thu, 12 Jul 2007 08:31:02 -0700
From: Michael Vilain <vilain@spamcop.net>
Subject: Re: Using MsAccess with Perl on a UNIX system
Message-Id: <vilain-7FFAB8.08310212072007@comcast.dca.giganews.com>

In article <1184234810.375580.192140@n2g2000hse.googlegroups.com>,
 "linux@colsen.org" <erpelkapper@gmail.com> wrote:

> Hello,
> 
> I am trying to build a script that creates and fills an MsAccess
> database (.mdb) in the right format on a UNIX-system (solaris).
> 
> The script needs to retrieve information from an existing MySQL
> database and put it in an MsAccess database on the UNIX-platform, so
> no connection can be made to a Windows machine. Later the will be FTP-
> ed to a windows machine, which can only load the data. ODBC is not
> possible.
> 
> The script is a perl script, but the solution to this prolbem, doesn't
> necessarily need to be with Perl.
> 
> Does anyone have experience in how to solve this problem?
> 
> Best regards,
> Gilian

Since Access is a proprietary Microsoft format, I haven't been able to 
find anyone who's reverse engineered it, legally or not.  You could 
export the data in CSV or even create an Excel spreadsheet using a CPAN 
module.

Or you might check out mdbtools.  It's not perl, but it might help.

http://mdbtools.sourceforge.net/

-- 
DeeDee, don't press that button!  DeeDee!  NO!  Dee...





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

Date: Thu, 12 Jul 2007 20:54:42 +0200
From: "Lambik" <lambik@kieffer.nl>
Subject: Re: Using MsAccess with Perl on a UNIX system
Message-Id: <46967883$0$37748$5fc3050@dreader2.news.tiscali.nl>

"linux@colsen.org" <erpelkapper@gmail.com> wrote in message
news:1184234810.375580.192140@n2g2000hse.googlegroups.com...
> Hello,
>
> I am trying to build a script that creates and fills an MsAccess
> database (.mdb) in the right format on a UNIX-system (solaris).
>
> The script needs to retrieve information from an existing MySQL
> database and put it in an MsAccess database on the UNIX-platform, so
> no connection can be made to a Windows machine. Later the will be FTP-
> ed to a windows machine, which can only load the data. ODBC is not
> possible.
>
> The script is a perl script, but the solution to this prolbem, doesn't
> necessarily need to be with Perl.
>
> Does anyone have experience in how to solve this problem?


You are not the first one. There is the ODBC Socket Server
(http://odbcsock.sourceforge.net/) where you still need a MS OS or there is
the UniverSQL (http://www.sidespace.com/products/universql/) where you need
to pay for but has a trail version. Then there is the ODBC ODBC bridge from
http://www.easysoft.com/.

All are plasters, not real solutions. Real solution: export the db using a
mysql odbc from a windows machine into a mysql db.




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

Date: Thu, 12 Jul 2007 09:35:32 -0700
From: "Clenna Lumina" <savagebeaste@yahoo.com>
Subject: Re: Using xargs perl to join lines
Message-Id: <5fn3f1F3d3f99U1@mid.individual.net>

Joe Smith wrote:
> charissaf@gmail.com wrote:
>
>> # sed -e :a -e '$!N;s/\n=/ /;ta' -e 'P;D'
>>
>> The error I receive is: N: Event not found.
>
> Are you aware that some shells require ! to be quoted as \! even
> inside ''? -Joe

My bash shell doesn't treat ! as special when in single quotes. 
Otherwise, it acts as a histoy shortcut:

$ echo 12345
12345
$ echo 123
123
$ echo ABC
ABC
$ history | tail -n 4 | head -n 3
25767  echo 12345
25768  echo 123
25769  echo ABC
$ perl -e 'print "[", shift, "]\n";' "!25767"
perl -e 'print "[", shift, "]\n";' "echo 12345"
[echo 12345]
$ perl -e 'print "[", shift, "]\n";' !25767
perl -e 'print "[", shift, "]\n";' echo 12345
[echo]
$ perl -e 'print "[", shift, "]\n";' '!25767'
[!25767]
$ perl -e 'print "[", shift, "]\n";' \!25767
[!25767]
$ echo $SHELL
/bin/bash
$ bash --version
GNU bash, version 2.05a.0(1)-release (i686-pc-linux-gnu) ...


Howver, I checked with tcsh, and it doesn't seem to care if it's single 
quoted or not (kinda odd?)

$ echo 123
123
$ echo 456
456
$ echo 789
789
$ history | tail -n 4 | head -n 3
     2  9:27    echo 123
     3  9:27    echo 456
     4  9:27    echo 789
$ perl -e 'print "[", shift, "]\n";' "!3"
perl -e 'print "[", shift, "]\n";' "echo 456"
[echo 456]
$ perl -e 'print "[", shift, "]\n";' '!3'
perl -e 'print "[", shift, "]\n";' 'echo 456'
[echo 456]
$ perl -e 'print "[", shift, "]\n";' '\!3'
[!3]
$ echo $version
tcsh 6.10.00 (Astron) 2000-11-19 (i386-intel-linux) ...


I thought all shells are not supposed regard single quoted characters as 
special?


> linux% date
> Thu Jul 12 01:43:44 PDT 2007
> linux% echo "a!N."
> N.: Event not found.
> linux% echo !da
> echo date
> date
> linux% echo $version
> tcsh 6.14.00 (Astron) 2005-03-25 (i386-intel-linux) ...
> linux% echo "a\!N."
> a!N.



-- 
CL 




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

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


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