[22128] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4350 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Jan 6 14:06:06 2003

Date: Mon, 6 Jan 2003 11:05:08 -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           Mon, 6 Jan 2003     Volume: 10 Number: 4350

Today's topics:
    Re: Generating extra whitespace in for loop <glex@qwest.net>
    Re: how to force a reload on a page <vispy@nortelnetworks.com>
    Re: how to force a reload on a page <flavell@mail.cern.ch>
    Re: how to refer to the array? <krahnj@acm.org>
    Re: how to refer to the array? (h\)
    Re: Inserting text top of plain/text MIME section <sjcole@no_spam.hotmail.com>
    Re: Need help with split news@roaima.freeserve.co.uk
    Re: Need help with split (Tad McClellan)
    Re: Need help with split news@roaima.freeserve.co.uk
        Noob:  Variable is getting reset, but why? <jackstraw@witchita>
    Re: Noob:  Variable is getting reset, but why? <nobull@mail.com>
    Re: Perl for spliting vcf files (palm->iPod) (Michael Robbins)
    Re: perl, linking perl with *myC*.lib <Juha.Laiho@iki.fi>
    Re: Problem with huge dataset, 100000000 a magic number <mthunter@students.uiuc.edu>
    Re: Problem with huge dataset, 100000000 a magic number <mthunter@students.uiuc.edu>
        Queer behavior (Mandar Amdekar)
    Re: Queer behavior <krahnj@acm.org>
    Re: Queer behavior (Tad McClellan)
    Re: Queer behavior <kasp@epatra.com>
    Re: regex code evaluation (??{code}) (weberh)
    Re: regexp question <someone@microsoft.com>
    Re: regexp question <andrew.no.spam.please.hutchinson@vanderbilt.edu>
        Running CGI scripts offline <cmps7331@hotmail.com>
    Re: Running CGI scripts offline <nobull@mail.com>
    Re: Running CGI scripts offline <wsegrave@mindspring.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Mon, 06 Jan 2003 13:02:35 -0600
From: Jeff D Gleixner <glex@qwest.net>
Subject: Re: Generating extra whitespace in for loop
Message-Id: <2okS9.3$Q8.9271@news.uswest.net>


> Why the extra whitespace--both in front of both numbers and the extra
> lines after the numbers? Thanks!

extra whitespace is due to: (.*?)  which matches any character, including blanks.

extra lines are due to: print "$result\n";    If $result isn't set, which will 
occur when it reads 'debug output: print() processed', it prints the value of 
$result, which is undef (nothing) and a newline.


This is probably more what you're after

foreach (@output) {
	print "$1\n" if /list\s*(\d+)\s*files/;
}

print the contents of $1 if a match is found containing..

list   the string 'list'.. followed by..
\s*    zero or more whitespace characters.. followed by..
(\d+)  one or more digits. (Match is kept as $1)  followed by..
\s*    zero or more whitespace characters.. followed by..
files  the string 'files'
-- 
Jeff Gleixner
Quote/Saying of the moment:
	Why don't they just make mouse-flavored cat food?



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

Date: Mon, 6 Jan 2003 08:54:24 -0600
From: "Vispy Sarkari" <vispy@nortelnetworks.com>
Subject: Re: how to force a reload on a page
Message-Id: <avc59d$m06$1@zcars0v6.ca.nortel.com>


"Rich" <rx323@xtra.co.nz> wrote in message news:1103_1041835100@TERIINI...
> Can someone please explain how i can force my script to reload the html
being displayed to the user.
> I have tried to find the answer myself but cannot.
> Thank you.
>
>

Try:

$redir = new CGI;
print $redir->redirect('Your http:// web page address');




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

Date: Mon, 6 Jan 2003 16:38:06 +0100
From: "Alan J. Flavell" <flavell@mail.cern.ch>
Subject: Re: how to force a reload on a page
Message-Id: <Pine.LNX.4.40.0301061622050.15107-100000@lxplus065.cern.ch>

On Jan 6, Joe Smith inscribed on the eternal scroll:

> In article <1103_1041835100@TERIINI>, Rich  <rx323@xtra.co.nz> wrote:
> >Can someone please explain how i can force my script to reload the html
> >being displayed to the user.
>
> http://wp.netscape.com/eng/mozilla/4.8/relnotes/windows-4.8.html

Not clear why you think the release notes for one version of one -
obsolete - browser design would offer a robust engineering solution to
a general WWW question.

>   To force the update

"force" doesn't really work on the WWW.  See Juergen's answer on this
thread, <GpaS9.162$1c.139@nwrddc01.gnilink.net> (now watch the
spammers harvest that as an email address ;-)

> of individual elements on a page, you can use
>   the following meta tags in the <HEAD></HEAD> section:
>      <META HTTP-EQUIV="Pragma" CONTENT="no-cache">

See http://www.mnot.net/cache_docs/#META to understand why there is
a better answer to that part, if it's relevant.

>      <META HTTP-EQUIV="Refresh" CONTENT="60">

Bad answer, and not only for the reasons I gave.

> This is not a perl question.

Right, which is why I'll not attempt to offer more-detailed
corrections.

Basically, it appears that the questioner hasn't yet got the mental
picture to understand how their problem fits into the technologies
they're using: the fact that they're cooking with Perl is a mere
side-issue.

My advice to the original poster is to move to the appropriate group,
probably comp.infosystems.www.authoring.cgi (auto-moderated: check its
posting guidelines for details), and explain in their posting what
they _really_ want to achieve in end-user terms, rather than this
half-solution that, as Juergen has explained, cannot work in the form
that it appears to be described.

good luck



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

Date: Mon, 06 Jan 2003 11:47:49 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: how to refer to the array?
Message-Id: <3E196C59.6A71E7EA@acm.org>

qjzhu wrote:
> 
>     if I have
> 
>         my %countyInfo = (
>           '1' => ['CITRUS', ['32650', '32651', '32652']],
>           '2' => ['ALACHUA', ['32653', '32654', '32655', '32656', '32657']],
>          );
> 
>     how can I push a new value into both array ['32650', '32651', '32652']
> and
>     ['32653', '32654', '32655', '32656', '32657']
> 
>     and make %countyInfo into
> 
>         my %countyInfo = (
>           '1' => ['CITRUS', ['32650', '32651', '32652', '11111']],
>           '2' => ['ALACHUA', ['32653', '32654', '32655', '32656', '32657',
> '11111']],
>          );


No need to quote everything.  :-)

$ perl -MData::Dumper -le'
my %countyInfo = (
    1 => [CITRUS  => [32650, 32651, 32652]],
    2 => [ALACHUA => [32653, 32654, 32655, 32656, 32657]],
    );
print Dumper( \%countyInfo );
push @{$countyInfo{$_}[1]}, 11111 for keys %countyInfo;
print Dumper( \%countyInfo );



John
-- 
use Perl;
program
fulfillment


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

Date: Mon, 6 Jan 2003 19:41:07 +0100
From: "Michael Peuser \(h\)" <post@mpeuser.de>
Subject: Re: how to refer to the array?
Message-Id: <avcii5$p14$02$1@news.t-online.com>


"John W. Krahn" <krahnj@acm.org> schrieb im Newsbeitrag
news:3E196C59.6A71E7EA@acm.org...

> No need to quote everything.  :-)

Exactly :-)

> push @{$countyInfo{$_}[1]}, 11111 for keys %countyInfo;

I think the previous line should read:
push @{$countyInfo{$_}  ->  [1]}, 11111 for keys %countyInfo;

or even simpler with Bens suggestion:
push @{$_  ->  [1]}, 11111 for values %countyInfo;


Kindly Mike




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

Date: Mon, 6 Jan 2003 14:02:52 -0000
From: "Steve C" <sjcole@no_spam.hotmail.com>
Subject: Re: Inserting text top of plain/text MIME section
Message-Id: <v1j33hojs0i10f@corp.supernews.com>

Thanks Tintin

Does MIME::Lite allow for a message already created to be passed to it via
STDIN.
(I'm passing mail from Exim to the perl script, which needs to add the text
to the plain/text bodypart and then pass back to Exim via STDOUT)

I looked briefly at the docs and there are many examples of creating mail
from scratch and writing back out, but was not sure if it allowed an
existing e-mail to be manipulated after receiving it in via STDIN.

Any ideas folks off the top of your head??

I'll plough on anyway and do some testing, but any help is appreciated.

Regards

Steve.

"Tintin" <me@privacy.net> wrote in message
news:ava7c1$dnags$1@ID-172104.news.dfncis.de...
>
> "Steve C" <sjcole@nospam.hotmail.com> wrote in message
> news:1041767591.506583@ananke.eclipse.net.uk...
> > Hi Folks,
> > Sorry - a newbie question..
> >
> > I'm looking to insert a line of text in the 'top' of an e-mail message
> body.
> > The problem is that some 'users' have HTML e-mail format enabled by
> default
> > (Outlook clients mainly)
> > also the plain/text section is not always the first MIME part
encountered
> > within the e-mail.  Also the text can't necessarily go immediately after
> the
> > plain/text Content-Type: header as sometimes you get an entry like
> > charset="iso-8859-1"
> > on the following line, or should I use 'paragraph mode' to get round
this?
> >
> > The mail message arrives on STDIN and needs to be passed back to STDOUT,
> > with a one line text hacked into the top of the plain/text part
bodypart.
> >
> > What would be the simplest way of going about this?
> >
> > Any help or pointers in the right direction would be appreciated.
>
> I'd use MIME::Lite and use multipart/alternative
>
>




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

Date: Mon, 6 Jan 2003 11:44:42 +0000
From: news@roaima.freeserve.co.uk
Subject: Re: Need help with split
Message-Id: <a7qbva.5ma.ln@moldev.cmagroup.co.uk>

Jodyman <Jodyman@hotmail.com> wrote:
> my ($results4) = $filename1 =~ /[\\|\/](\w+\.\w+)$/;

> Means look for either \ or /.

"John W. Krahn" <krahnj@acm.org> wrote in message
> Unix uses / Windows uses \   /[\\|\/](\w+\.\w+)$/;

Tad McClellan <tadmc@augustmail.com> wrote:
> Windows can also use /.

Further, UNIX type filesystems can include \ as a valid filename
character:

    $ ls -ltr
    total 0
    -rw-rw-r--    1 vwedi    vwedi           0 Jan  6 11:43 one
    -rw-rw-r--    1 vwedi    vwedi           0 Jan  6 11:43 two three
    -rw-rw-r--    1 vwedi    vwedi           0 Jan  6 11:43 four\five

Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


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

Date: Mon, 6 Jan 2003 08:31:07 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Need help with split
Message-Id: <slrnb1j4pb.bhg.tadmc@magna.augustmail.com>

news@roaima.freeserve.co.uk <news@roaima.freeserve.co.uk> wrote:

> Further, UNIX type filesystems can include \ as a valid filename
> character:


I seem to remember that there are only 2 ASCII characters
that are not allowed in a *nix filename: slash and NUL


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


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

Date: Mon, 6 Jan 2003 15:22:16 +0000
From: news@roaima.freeserve.co.uk
Subject: Re: Need help with split
Message-Id: <8v6cva.31f.ln@moldev.cmagroup.co.uk>

Tad McClellan <tadmc@augustmail.com> wrote:
>> Further, UNIX type filesystems can include \ as a valid filename
>> character:

> I seem to remember that there are only 2 ASCII characters
> that are not allowed in a *nix filename: slash and NUL

That feels about right. The OP's RE, even if it had had the | in the right
place, would have also broken on at least one of my example filenames.

Regards,
Chris
-- 
@s=split(//,"Je,\nhn ersloak rcet thuarP");$k=$l=@s;for(;$k;$k--){$i=($i+1)%$l
until$s[$i];$c=$s[$i];print$c;undef$s[$i];$i=($i+(ord$c))%$l}


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

Date: Mon, 06 Jan 2003 13:04:32 -0500
From: Jack Straw <jackstraw@witchita>
Subject: Noob:  Variable is getting reset, but why?
Message-Id: <brgj1vo47c1mo2ta8r4o0fq697bchaudnk@4ax.com>

OK.  What I'm trying to do is to read a report of which files reside
on which tapes.  I want to perform some work for a few specific tapes
in particular: Y00545, Y01779, etc.

I'm an intermediate at best, so I'm chalking this up to a learning
experience and double-checking my results a lot.

What I don't understand is, that when I double-check my answers, the
total-bytes number is for the last tape only, not the sum for the
entire list of tapes that I have in my regexp.  Why would that be?  

Even if I have a 'miss' or a bytes=0, the fact that I'm always doing a
+= should mean that $to_be_recalled_bytes should only increment, and
never be reset, right?

I'm pretty confused as to why this would be happening....


If my post wasn't clear, let's assume this small example

Tape1  22
Tape2  34
Tape2  16
Tape3  67
Tape3 11

My sum is coming up as 78, not as 150.

Thanks for your help, and for an informative group.  Code follows...






#!/usr/bin/perl -w

# $to_be_recalled_count	number of versions that need to be recalled
# $to_be_recalled_bytes	bytes of data that need to be recalled
# $total_version_count	number of versions found in the input file

# read dump of all versions
open (INPUT, $ARGV[0])  or die "Couldn't open input file.\n";

while (<INPUT>){

	if (/^.{183}Y00545|Y01779|Y07001.{60}(.{10})/){
		$to_be_recalled_count++;
		$to_be_recalled_bytes += $1;
	}
	$total_version_count++;
}
print "\n";
print "Recall count:  $to_be_recalled_count\n";
print "Recall bytes:  $to_be_recalled_bytes\n";
print "Total version count:  $total_version_count\n";


-- 
JackStraw
0x3D561045

"Was it over when the Germans bombed Pearl Harbor? Hell no!"
     -- Bluto


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

Date: 06 Jan 2003 18:38:37 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Noob:  Variable is getting reset, but why?
Message-Id: <u9bs2ugm36.fsf@wcl-l.bham.ac.uk>

Jack Straw <jackstraw@witchita> writes:

> Subject: Noob:  Variable is getting reset, but why?

"Noob" will be read as "person too lazy to read the manual and can't
even spell newbie".

If this is the case then please read the manuals before you posr.

If this is _not_ the case then why waste valuable space in your
subject line to give the wrong impression?

Have you actually tried running under the debugger or putting in some
dianostic prints to see if the variable really is getting reset?

No, you haven't.

It was just a wild, and completely inaccurate, guess.

Note: Every newbie who comes here gets advised to always enable
warnings and strictures?  Why do you think this is?

From a purely selfish point of view it's because those of us who like
to come here and solve problems for people want interesting problems
to solve.  We don't want to waste our time on boring problems like
this.

From a wider, less selfish, point of view - it would mean that more
of our time was available to answer questions from people who could
have avoided/solved their own problems just by working with warnings
and strictures enabled.

I notice that you did enable warnings.  And the warnings your code
generates should have given a big clue as to what was wrong.

> What I don't understand is, that when I double-check my answers, the
> total-bytes number is for the last tape only, not the sum for the
> entire list of tapes that I have in my regexp.  Why would that be?

Because your regex is wrong. 

Your regex may match 3 different tagets but only in one is anything
captured in $1.

That's why you see the warning "Use of uninitialized value in
addition (+)" in the line where you do:

>		$to_be_recalled_bytes += $1;

Your regex was:

>  /^.{183}Y00545|Y01779|Y07001.{60}(.{10})/

You meant:

  /^.{183}(?:Y00545|Y01779|Y07001).{60}(.{10})/

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: 6 Jan 2003 04:31:23 -0800
From: michael.robbins@us.cibc.com (Michael Robbins)
Subject: Re: Perl for spliting vcf files (palm->iPod)
Message-Id: <c6c65b14.0301060431.4c143fca@posting.google.com>

> If the records are separated by blank lines you can use paragraph mode to read each record.

<snip>

Thank you very much.  It works nicely.  'much more perl-like.

I just added

$sinkfilename =~ s/[^\w~,\- ]//g; 

before the line that reads

my $count = '';

in order to avoid characters that the OS didn't like.


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

Date: Mon, 06 Jan 2003 11:07:00 GMT
From: Juha Laiho <Juha.Laiho@iki.fi>
Subject: Re: perl, linking perl with *myC*.lib
Message-Id: <avbnrg$lsi$3@ichaos.ichaos-int>

morrowind@metropolis.de (Riccardo Amati) said:
>I would like to 
>(a) re-use my old myC.lib (or whatever old *.Lib i got), a *.Lib
>compiled under unix, originally c or gnuc, got the souces somewhere
>too,
>and
>(b) call it or use it, whereby the caller is a perl *.pl program.
>
>Question 1: how do i link it to the perl main prg? Just by stating
>'use my.lib;,' inside , or by 'perl -m my.lib' on the perl command
>line?
>
>Question 2: how do i convert the parameters of any lib function, so
>they fit in perl and fit in C too?
>
>Question 3: is there a book about it, i didnt read yet? (i am in
>Germany, so not all good old merry English books come to me
>deliberatly, but as son as i got the title, i could ...).

The "perlembed" documentation (available w. command "perldoc perlembed",
included in perl distribution, says:
       Do you want to:

       Use C from Perl?
            Read the perlxstut manpage, the perlxs manpage, the
            h2xs manpage, and the perlguts manpage.

 ... where the perlxstut, perlxs, h2xs and perlguts are also readable via
the perldoc command.

I hope this helps. And as this mostly seems to be a Perl issue, I'll
direct followups to comp.lang.perl.misc.
-- 
Wolf  a.k.a.  Juha Laiho     Espoo, Finland
(GC 3.0) GIT d- s+: a C++ ULSH++++$ P++@ L+++ E- W+$@ N++ !K w !O !M V
         PS(+) PE Y+ PGP(+) t- 5 !X R !tv b+ !DI D G e+ h---- r+++ y++++
"...cancel my subscription to the resurrection!" (Jim Morrison)


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

Date: Mon, 06 Jan 2003 18:39:58 GMT
From: Mike Hunter <mthunter@students.uiuc.edu>
Subject: Re: Problem with huge dataset, 100000000 a magic number?
Message-Id: <slrnb1jjhf.i3q.mthunter@ux12.cso.uiuc.edu>

On Sat, 04 Jan 2003 01:35:21 GMT, John W. Krahn wrote:

>  If you are not using $starttime, $endtime, $source_interface, $dest_interface,
>  $ip_prot and $tcp_flags there is no reason to declare them.
>  
>           my ( undef, undef, undef, $source_ip, $source_port,
>               undef, $dest_ip, $dest_port, undef, undef,
>               $packets, $octets ) = split;

That's a good idea.

Thanks,

Mike


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

Date: Mon, 06 Jan 2003 18:42:20 GMT
From: Mike Hunter <mthunter@students.uiuc.edu>
Subject: Re: Problem with huge dataset, 100000000 a magic number?
Message-Id: <slrnb1jjlt.i3q.mthunter@ux12.cso.uiuc.edu>

On Sun, 05 Jan 2003 22:01:35 GMT, Martien Verbruggen wrote:
>  On Fri, 03 Jan 2003 19:02:59 GMT,
>  	Mike Hunter <mthunter@students.uiuc.edu> wrote:
> > Greetings all,
> > 
> > I'm using perl to crunch some data generated from flow-tools.  My script
> > works well until I get into really large data, where I end up with
> > problems.  I may very well be running the machine out of memory, but
> > some recent debugging output produced this:
> > 
> > processing line 99900000
> > processing line 99950000
> > processing line 100000000
>  
>  Could it be that somewhere around line 100000000 you pass the 2 GB
>  mark [1]? Is the file larger than 2 GB, and if so, does your Perl on your
>  OS support that?

How does one tell what the local limits are?

Thanks,

Mike


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

Date: 6 Jan 2003 08:01:11 -0800
From: mandar_amdekar@hotmail.com (Mandar Amdekar)
Subject: Queer behavior
Message-Id: <abe1bc22.0301060801.37649e03@posting.google.com>

I'm using as perl v5.6.1 built for MSWin32-x86-multi-thread

Here are 2 ways of writing the same small program:
1>
print("Input: ");
my($var) = <STDIN>;
print("Your input = $var\n");

2>
print("Input: ");
my($var);
$var = <STDIN>;
print("Your input = $var\n");

When I run 1, the <ENTER> does not end the stdin steam, which is not
what I want, but program 2 does end the stdin steam on hitting
<ENTER>.

Is this expected behavior? And if so, why?
Thanks.


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

Date: Mon, 06 Jan 2003 16:32:35 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: Queer behavior
Message-Id: <3E19AF17.5ED0CF5E@acm.org>

Mandar Amdekar wrote:
> 
> I'm using as perl v5.6.1 built for MSWin32-x86-multi-thread
> 
> Here are 2 ways of writing the same small program:
> 1>
> print("Input: ");
> my($var) = <STDIN>;
> print("Your input = $var\n");
> 
> 2>
> print("Input: ");
> my($var);
> $var = <STDIN>;
> print("Your input = $var\n");
> 
> When I run 1, the <ENTER> does not end the stdin steam, which is not
> what I want, but program 2 does end the stdin steam on hitting
> <ENTER>.
> 
> Is this expected behavior? And if so, why?

Yes it is.  Because the parenthesis force a list context which requires
you to send an EOF signal (Ctrl-D in *nix or Ctrl-Z in Windows.)  Just
remove all the parenthesis.

print "Input: ";
my $var = <STDIN>;
print "Your input = $var\n";



John
-- 
use Perl;
program
fulfillment


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

Date: Mon, 6 Jan 2003 10:35:06 -0600
From: tadmc@augustmail.com (Tad McClellan)
Subject: Re: Queer behavior
Message-Id: <slrnb1jc1q.bvh.tadmc@magna.augustmail.com>

Mandar Amdekar <mandar_amdekar@hotmail.com> wrote:

> Here are 2 ways of writing the same small program:
> 1>
> print("Input: ");
> my($var) = <STDIN>;


Input operator is in "list context", reads _all_ of the lines,
puts the first line in $var, discards all the rest of the lines.


> print("Your input = $var\n");
> 
> 2>
> print("Input: ");
> my($var);
> $var = <STDIN>;


Input operator is in "scalar context", reads only the next line of input.

If you remove the parenthesis in #1, you can get scalar context:

   my $var = <STDIN>;  # same behavior as #2


> print("Your input = $var\n");
> 
> When I run 1, the <ENTER> does not end the stdin steam, which is not
> what I want, but program 2 does end the stdin steam on hitting
><ENTER>.
> 
> Is this expected behavior? 


Yes.

See the "Context" section in:

   perldoc perldata


> And if so, why?


Because it is waiting for the entire file to be input in the first case. 
You can enter ctrl-Z (I think) to signal EOF from the terminal.


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


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

Date: Mon, 6 Jan 2003 22:16:13 +0530
From: "Kasp" <kasp@epatra.com>
Subject: Re: Queer behavior
Message-Id: <avcbsq$1dk$1@newsreader.mailgate.org>

Yes, the behaviour you observed is correct. See my reasoning inline.

> my($var) = <STDIN>;

This means that $var will be treated like a list. So you can enter as many
elements as you want and send an End Of Data by Cntrl+Z (or D).

> print("Your input = $var\n");
>
> 2>
> print("Input: ");
> my($var);

This does not make much sense. You have declared a variable and are treating
it as a list. But it is ineffective as you are not using it's
list-capabilities.

> $var = <STDIN>;




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

Date: 6 Jan 2003 04:11:23 -0800
From: weberh@zedat.fu-berlin.de (weberh)
Subject: Re: regex code evaluation (??{code})
Message-Id: <7003ec4a.0301060411.1f0c720@posting.google.com>

Thanks Benjamin,

that's exactly what I have been looking for.
Even the more sophisticated solution works fine:

perl -ne 'print "$&\n" while /([...]{m,n})([...]{p,q}(??{reverse $1}))/g'

Harald




Benjamin Goldberg <goldbb2@earthlink.net> wrote in message 
> 
> Try:
> 
>    perl -ne 'print "$&\n" while /(\w{6})(.*?(??{reverse $1}))/g'
> 
> (Note the /g on the end of the regex)


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

Date: Mon, 6 Jan 2003 23:03:04 +1100
From: "C3" <someone@microsoft.com>
Subject: Re: regexp question
Message-Id: <3e196fd0$0$5701$afc38c87@news.optusnet.com.au>

Mixed in among drivel, trolls and general idiocy regarding whether
top-posting is correct, "Joe Smith" utterred these words of wisdom:


> Problem: '.*' matches any number of slashes.

Gotcha.

> The first one matches one slash followed by any number of characters,
> whether they are slashes or not.  The second one finds the minimum
> positive match.  '(/[^/]*)' is more appropriate than '(/.*)'.

Your explanation makes sense, but I don't understand the idea behind your
regex. Could you please explain it to me?

> Of course, the other solutions involving tr/// better match your task.

To be completely honest, I'm not even using perl so that may even be the
problem. I'm using an add-on called squirm for the squid proxy server. A
google search will find it.


cheers,

C3




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

Date: Mon, 06 Jan 2003 10:49:28 -0600
From: A2 <andrew.no.spam.please.hutchinson@vanderbilt.edu>
Subject: Re: regexp question
Message-Id: <ndaj1vshv4vps7v19rde93tpj9nf612agb@4ax.com>

Here's an explanation of the regex:

(  --> Start of grouping

/  --> Matches one '/' character

[^/]  --> Negated character class - matches anything _except_ a '/'
character

*  --> Quantifier - matches zero or more of the  last pattern (which
was the [^/] class)

)  --> End of grouping

So, in a nutshell, what (/[^/]*) means is "match a slash, followed by
zero or more characters that are not a slash".

Hope this helps,

Andrew

On Mon, 6 Jan 2003 23:03:04 +1100, "C3" <someone@microsoft.com> wrote:

>Mixed in among drivel, trolls and general idiocy regarding whether
>top-posting is correct, "Joe Smith" utterred these words of wisdom:
>
>
>> Problem: '.*' matches any number of slashes.
>
>Gotcha.
>
>> The first one matches one slash followed by any number of characters,
>> whether they are slashes or not.  The second one finds the minimum
>> positive match.  '(/[^/]*)' is more appropriate than '(/.*)'.
>
>Your explanation makes sense, but I don't understand the idea behind your
>regex. Could you please explain it to me?
>
>> Of course, the other solutions involving tr/// better match your task.
>
>To be completely honest, I'm not even using perl so that may even be the
>problem. I'm using an add-on called squirm for the squid proxy server. A
>google search will find it.
>
>
>cheers,
>
>C3
>



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

Date: Mon, 6 Jan 2003 11:03:50 -0600
From: "Cmps" <cmps7331@hotmail.com>
Subject: Running CGI scripts offline
Message-Id: <avccl8$56o$1@saluki-news.it.siu.edu>

My question involves running CGI scripts while offline.  I don't use UNIX
and only an Internet Explorer browser.  The problem is when I am not
connected and try to run a CGI script by loading it in the browser, it
prompts Open... or Save...   If online and the script is in a server's non
CGI-BIN directory it does the same.  It will only work uploading the file to
CGI-BIN and calling it from there.  No other directory.  Besides using the
ActivePerl from the MS-DOS prompt to just test it with no graphical
interface, is there some kind of options to set in the Internet Explorer to
run scripts correctly?   Is there a quick and easy Win32 MicroSoft Visual
Studio like compiler to run Perl scripts?  Thanks.





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

Date: 06 Jan 2003 17:31:56 +0000
From: Brian McCauley <nobull@mail.com>
Subject: Re: Running CGI scripts offline
Message-Id: <u9r8bqgp6b.fsf@wcl-l.bham.ac.uk>

"Cmps" <cmps7331@hotmail.com> writes:

> My question involves running CGI scripts while offline.  I don't use
> UNIX and only an Internet Explorer browser.  The problem is when I
> am not connected and try to run a CGI script by loading it in the
> browser, it prompts Open... or Save...  If online and the script is
> in a server's non CGI-BIN directory it does the same.  It will only
> work uploading the file to CGI-BIN and calling it from there.  No
> other directory.  Besides using the ActivePerl from the MS-DOS
> prompt to just test it with no graphical interface, is there some
> kind of options to set in the Internet Explorer to run scripts
> correctly?

This is a question about Internet Explorer, not Perl.  The answer is
probably "no" - CGI is not something that's usually in Browsers, it's
usually in HTTP servers.

Install a web server.  Most modern OSs come with at least a simple one
as standard.  If your OS does not (or you want a better one) then you
can probably find a binary of Apache that'll run on your OS.  This, of
course, has nothing to do with Perl.

>   Is there a quick and easy Win32 MicroSoft Visual
> Studio like compiler to run Perl scripts?  Thanks.

Sorry, I don't get deeply enough into MicroSoft specific stuff to even
really understand the question.

-- 
     \\   ( )
  .  _\\__[oo
 .__/  \\ /\@
 .  l___\\
  # ll  l\\
 ###LL  LL\\


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

Date: Mon, 6 Jan 2003 12:33:49 -0600
From: "William Alexander Segraves" <wsegrave@mindspring.com>
Subject: Re: Running CGI scripts offline
Message-Id: <avciik$ftd$1@slb6.atl.mindspring.net>


"Cmps" <cmps7331@hotmail.com> wrote in message
news:avccl8$56o$1@saluki-news.it.siu.edu...
> My question involves running CGI scripts while offline.  I don't use UNIX
> and only an Internet Explorer browser.
<snip>

Not a Perl question, but ...

Download and install IndigoPerl, available free from www. indigostar.com,
and you'll have a pre-configured installation of Perl and Apache.

Put your web pages in c:\indigoperl\htdocs and your Perl scripts in
c:\indigoperl\cgi-bin. To debug your scripts from the command line,

cd \indigoperl\cgi-bin
 ..\bin\perl -c yourscript.pl

Your scripts should start with something like

#!perl -w
# description of your script
use strict;
# rest of your code

Cheers.

Bill Segraves




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

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


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