[19290] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1485 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Fri Aug 10 09:05:40 2001

Date: Fri, 10 Aug 2001 06:05:13 -0700 (PDT)
From: Perl-Users Digest <Perl-Users-Request@ruby.OCE.ORST.EDU>
To: Perl-Users@ruby.OCE.ORST.EDU (Perl-Users Digest)
Message-Id: <997448713-v10-i1485@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Fri, 10 Aug 2001     Volume: 10 Number: 1485

Today's topics:
        A Simple Regular Expression !! <henryb@ntlworld.com>
    Re: A Simple Regular Expression !! <krahnj@acm.org>
    Re: A Simple Regular Expression !! <philippe.perrin@sxb.bsf.alcatel.fr>
    Re: bitvector functionality question <bart.lateur@skynet.be>
    Re: Can't Negate Regex /^8([0876])\1\d+$/ <bart.lateur@skynet.be>
    Re: code doesn't work from "learning perl" (Randal L. Schwartz)
    Re: compare Net::FTP and LWP ? <bkennedy99@Home.com>
        Connecting to a remote MS SQL server <jimt+nospam@netins.net>
        Encrypted Email <Jeff@aetherweb.co.uk>
        FAQ: How do I change one line in a file/delete a line i <faq@denver.pm.org>
    Re: File::Find : cannot figure it out. (Randal L. Schwartz)
    Re: help with hash (Jeff Ohlman)
    Re: How to get Mac and IP address of computers over a n <mark.riehl@agilecommunications.com>
    Re: How to get Mac and IP address of computers over a n (Helgi Briem)
        how to get perlscript <lbell@essex.ac.uk>
    Re: Is an element in a table ? <tinamue@zedat.fu-berlin.de>
    Re: Is this a Perl bug? flamencoman@earthlink.net
    Re: Is this a Perl bug? flamencoman@earthlink.net
        Learning Perl, 2nd Edition (Haakon Riiser)
    Re: Learning Perl, 2nd Edition (Randal L. Schwartz)
    Re: Location: cgi problem (Anno Siegel)
    Re: Newsletter Script <Thomas@Baetzler.de>
    Re: Newsletter Script <bcaligari@fireforged.com>
    Re: Newsletter Script <ommadawn@club-internet.fr>
    Re: permuting extremely large string (Anno Siegel)
    Re: Reading a NT directory from Unix <Thomas@Baetzler.de>
        telnet session through perl <e.quesada@verizon.net>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: Fri, 10 Aug 2001 11:33:59 -0700
From: "Henry Butowsky" <henryb@ntlworld.com>
Subject: A Simple Regular Expression !!
Message-Id: <i7Pc7.9902$zs.55582@news11-gui.server.ntli.net>

Hello there,

I need to see if two strings are equal have tried
e.g $country = "BIAFRA(HELLO)"

 .eg if(  $test =~ /^$country$/ ){ .... }

But the expression doen't work when there are brackets in the string,
Anybody got any ideas what I can do ?





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

Date: Fri, 10 Aug 2001 11:34:05 GMT
From: "John W. Krahn" <krahnj@acm.org>
Subject: Re: A Simple Regular Expression !!
Message-Id: <3B73C710.9BE0F87D@acm.org>

Henry Butowsky wrote:
> 
> Hello there,
> 
> I need to see if two strings are equal have tried
> e.g $country = "BIAFRA(HELLO)"

if ( $country eq "BIAFRA(HELLO)" ) {


> .eg if(  $test =~ /^$country$/ ){ .... }

if ( $test =~ /^\Q$country\E$/ ){ .... }


> But the expression doen't work when there are brackets in the string,
> Anybody got any ideas what I can do ?



John
-- 
use Perl;
program
fulfillment


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

Date: Fri, 10 Aug 2001 13:48:12 +0200
From: Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr>
Subject: Re: A Simple Regular Expression !!
Message-Id: <3B73C9FC.168BC81@sxb.bsf.alcatel.fr>

braquets are part of regular expressions.
why not use

$country = "BIAFRA(HELLO)";
if($test eq $country) { ... }

?

Henry Butowsky wrote:
> 
> Hello there,
> 
> I need to see if two strings are equal have tried
> e.g $country = "BIAFRA(HELLO)"
> 
> .eg if(  $test =~ /^$country$/ ){ .... }
> 
> But the expression doen't work when there are brackets in the string,
> Anybody got any ideas what I can do ?

-- 
PhP


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

Date: Fri, 10 Aug 2001 12:40:32 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: bitvector functionality question
Message-Id: <9bl7ntoqn99vfi0mt8kistnce0uvqo4di5@4ax.com>

Douglas du Boulay wrote:

>I am new to using perl string bitvectors i.e. vec() operations and I was
>wondering is there any way to add bitvectors  i.e. an addition "+"
>function , or is there a a way to apply shift right and shift left
>operations on these bitvectors?

No... bit vectors are strings, which you can use as compact
(one-dimensional) arrays. You don't ask if you can easily add arrays, do
you? Er... left shift and right shift on arrays is easy to do, with
shift/unshift/push/pop. In a imilar manner, you can use substr() or
other similar sting manipulation functions, if you want to move around
bit vectors in whole bytes. But that's basically it.

You can do item by item addition, in a loop. vec() makes a perfectly
wellbehaving L-value.

Do note that you can use bitwise operators, & | ^ , on these strings as
well.

-- 
	Bart.


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

Date: Fri, 10 Aug 2001 12:45:51 GMT
From: Bart Lateur <bart.lateur@skynet.be>
Subject: Re: Can't Negate Regex /^8([0876])\1\d+$/
Message-Id: <mol7nt08ijojesaaetm6nk60nnsn6hhf3u@4ax.com>

Victor Araujo wrote:

>I am trying to negate the following regex which I am using
>to filter toll free numbers. The regex seems to work fine as
>is but when I try to negated it won't work.
>
>$regex =~ /^8([0876])\1\d+$/;

Do note that in the last few days, there was a question here on
inverting a regex without using !~. Your case is even simpler because
it's anchored.

This might work:

	/^(?!8([0876])\1)\d+$/

-- 
	Bart.


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

Date: 10 Aug 2001 03:25:12 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: code doesn't work from "learning perl"
Message-Id: <m1n158i54n.fsf@halfdome.holdit.com>

>>>>> "Kevin" == Kevin Bartz <l_pantin@hotmail.com> writes:

Kevin> That's an old oversight from Learning Perl. That type of series
Kevin> generator can take only integers. From the command line, perl -e
Kevin> "print join \"\n\", (1.2 .. 5.2)" gives me 1-5, not 1.2-5.2.

Yes.  Rented brane that day.  Took back next day.

print "Just another Perl hacker,"

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: Fri, 10 Aug 2001 13:03:02 GMT
From: "Ben Kennedy" <bkennedy99@Home.com>
Subject: Re: compare Net::FTP and LWP ?
Message-Id: <aYQc7.89368$EP6.21828923@news1.rdc2.pa.home.com>


"Dan Baker" <dan@nospam_dtbakerprojects.com> wrote in message
news:3B7359B0.74B83CD8@nospam_dtbakerprojects.com...
> I am trying to decide which module to start experimenting with to code a
> web-driven administrative interface that will be used to "sync" files
> from a local PC to a remote domain. I am having trouble determining
> which module would be best for:
> - getting the file info to determine last_modified dates
> - pushing files from local PC to remote domain
> - (possibly) pulling new files from remote domain to local PC

As far as I know LWP uses Net::FTP to "do the dirty work", so I imagine
there are no signifigant performance reasons to use one over the other.  I'd
say use LWP if you are working on an app that is using ftp:// style
adddresses (saving you the working of parsing the username, password,
navigation, etc) and use Net::FTP for anything that requires more than a
simple download (anything interactive, uploading, etc).  Hope this helps

--Ben Kennedy




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

Date: Thu, 09 Aug 2001 10:37:41 -0500
From: Jim Turner <jimt+nospam@netins.net>
Subject: Connecting to a remote MS SQL server
Message-Id: <3B72AE45.F5BB48B0@netins.net>

Hi,

    I'm a bit confused on what I should be doing
to accomplish this.  I'm very new to database
interaction using perl.

    The server I am trying to connect to is a
generic install of MS SQL (v6.0 I believe, but
I may be wrong there) on a NT server in a remote
office.  What I will be connecting from is a
Digital UNIX 4.0e server.  Perl version installed
is 5.6.0.

    From what I've read, I need to have either
MSSQL::BDlib, DBD::ODBC, or DBD::Sybase.  But I
assume I need some sort of SQL DB libraries to
link against.  Then there is some discussion of
perl DBI, but none of these has a clear desciption
of what is needed for installation and in what
order.

    Also, it appears as if a lot of these are
meant for connections in which the DB is on the
same machine as the perl script.  This is not
my case, obviously.

    If anyone has some pointers to documentation,
books, or suggestions on things that have worked,
I would be in your debt.

    Thanks.

__
Jim Turner
Systems Administration
netINS, Inc.



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

Date: Fri, 10 Aug 2001 13:36:53 +0100
From: "Jeff Snoxell" <Jeff@aetherweb.co.uk>
Subject: Encrypted Email
Message-Id: <9l0kj0$sr1$1@neptunium.btinternet.com>

Hi,

Thanks for everyone's help with my BigInt and other problems.

I'm still no closer to a solution however.

I need a way to send 128-bit (minimum) encrypted emails from my ISP's linux
server to my Outlook Express inbox. I have CGI and FTP access to the server
but I don't have telnet and hence cannot easily install modules (I never
seem to have any luck with installing modules even when I do have telnet
access). I'm willing to spend a small amount of money to register some
shareware if necessary.

Please help, I've been stuck on this problem for 48 hours now and my mind is
melting.

Thanks,

--
Jeff Snoxell B.Sc.
Technical Director - Aetherweb Ltd (York)
+44 (0) 1904 656334
+44 (0) 7957 257391

http://www.aetherweb.co.uk






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

Date: Fri, 10 Aug 2001 12:17:01 GMT
From: PerlFAQ Server <faq@denver.pm.org>
Subject: FAQ: How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?
Message-Id: <1hQc7.1$V3.170765824@news.frii.net>

This message is one of several periodic postings to comp.lang.perl.misc
intended to make it easier for perl programmers to find answers to
common questions. The core of this message represents an excerpt
from the documentation provided with every Standard Distribution of
Perl.

+
  How do I change one line in a file/delete a line in a file/insert a line in the middle of a file/append to the beginning of a file?

    Those are operations of a text editor. Perl is not a text editor. Perl
    is a programming language. You have to decompose the problem into
    low-level calls to read, write, open, close, and seek.

    Although humans have an easy time thinking of a text file as being a
    sequence of lines that operates much like a stack of playing cards--or
    punch cards--computers usually see the text file as a sequence of bytes.
    In general, there's no direct way for Perl to seek to a particular line
    of a file, insert text into a file, or remove text from a file.

    (There are exceptions in special circumstances. You can add or remove
    data at the very end of the file. A sequence of bytes can be replaced
    with another sequence of the same length. The "$DB_RECNO" array bindings
    as documented in the DB_File manpage also provide a direct way of
    modifying a file. Files where all lines are the same length are also
    easy to alter.)

    The general solution is to create a temporary copy of the text file with
    the changes you want, then copy that over the original. This assumes no
    locking.

        $old = $file;
        $new = "$file.tmp.$$";
        $bak = "$file.orig";

        open(OLD, "< $old")         or die "can't open $old: $!";
        open(NEW, "> $new")         or die "can't open $new: $!";

        # Correct typos, preserving case
        while (<OLD>) {
            s/\b(p)earl\b/${1}erl/i;
            (print NEW $_)          or die "can't write to $new: $!";
        }

        close(OLD)                  or die "can't close $old: $!";
        close(NEW)                  or die "can't close $new: $!";

        rename($old, $bak)          or die "can't rename $old to $bak: $!";
        rename($new, $old)          or die "can't rename $new to $old: $!";

    Perl can do this sort of thing for you automatically with the "-i"
    command-line switch or the closely-related "$^I" variable (see the
    perlrun manpage for more details). Note that "-i" may require a suffix
    on some non-Unix systems; see the platform-specific documentation that
    came with your port.

        # Renumber a series of tests from the command line
        perl -pi -e 's/(^\s+test\s+)\d+/ $1 . ++$count /e' t/op/taint.t

        # form a script
        local($^I, @ARGV) = ('.orig', glob("*.c"));
        while (<>) {
            if ($. == 1) {
                print "This line should appear at the top of each file\n";
            }
            s/\b(p)earl\b/${1}erl/i;        # Correct typos, preserving case
            print;
            close ARGV if eof;              # Reset $.
        }

    If you need to seek to an arbitrary line of a file that changes
    infrequently, you could build up an index of byte positions of where the
    line ends are in the file. If the file is large, an index of every tenth
    or hundredth line end would allow you to seek and read fairly
    efficiently. If the file is sorted, try the look.pl library (part of the
    standard perl distribution).

    In the unique case of deleting lines at the end of a file, you can use
    tell() and truncate(). The following code snippet deletes the last line
    of a file without making a copy or reading the whole file into memory:

            open (FH, "+< $file");
            while ( <FH> ) { $addr = tell(FH) unless eof(FH) }
            truncate(FH, $addr);

    Error checking is left as an exercise for the reader.

- 

Documents such as this have been called "Answers to Frequently
Asked Questions" or FAQ for short.  They represent an important
part of the Usenet tradition.  They serve to reduce the volume of
redundant traffic on a news group by providing quality answers to
questions that keep coming up.

If you are some how irritated by seeing these postings you are free
to ignore them or add the sender to your killfile.  If you find
errors or other problems with these postings please send corrections
or comments to the posting email address or to the maintainers as
directed in the perlfaq manual page.

Answers to questions about LOTS of stuff, mostly not related to
Perl, can be found by pointing your news client to

    news:news.answers

or to the many thousands of other useful Usenet news groups.

Note that the FAQ text posted by this server may have been modified
from that distributed in the stable Perl release.  It may have been
edited to reflect the additions, changes and corrections provided
by respondents, reviewers, and critics to previous postings of
these FAQ. Complete text of these FAQ are available on request.

The perlfaq manual page contains the following copyright notice.

  AUTHOR AND COPYRIGHT

    Copyright (c) 1997-1999 Tom Christiansen and Nathan
    Torkington.  All rights reserved.

This posting is provided in the hope that it will be useful but
does not represent a commitment or contract of any kind on the part
of the contributers, authors or their agents.

                                                           05.02
-- 
    This space intentionally left blank


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

Date: 10 Aug 2001 03:30:37 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: File::Find : cannot figure it out.
Message-Id: <m1itfwi4vm.fsf@halfdome.holdit.com>

>>>>> "Sami" == Sami Jarvinen <if.xoboi@jks.invalid> writes:

Sami> Logan Shaw wrote:
>> After looking at the documentation for File::Find, I can't see where it
>> says that "find" will do anything in particular with the return value
>> of your code.

Sami> Btw, the documentation for File::Find seems to have nothing to say 
Sami> about _find()'s return value_.

And the usual rules about undocumented thingies apply.  If it's
undocumented, there's nothing for public consumption there.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 10 Aug 2001 05:22:10 -0700
From: jeffohlman@yahoo.com (Jeff Ohlman)
Subject: Re: help with hash
Message-Id: <5286e5d5.0108100422.3a7d9d4c@posting.google.com>

"Ryan Gralinski" <ryan@bong.net> wrote in message news:<iooc7.1547$5d2.4587@news1.wwck1.ri.home.com>...
> can someone help me out,
> i have a list of files downloaded off my web site
> 
> i read in the file, and store it like this..
> while($filename=<thelist>)
> {
>      chomp $filename;
>        $file{$filename}++;
> }
> close thelist;
> 
>

#a minor variation - allows you to reference values and keys with one statement
 
my $max=0;

while( (my $a, my $b) = each %filename)
{
    if ( $b > $max ) {
        $file = $a;
        $max = $b;
    }
};

print "$file was $max\n";


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

Date: Fri, 10 Aug 2001 11:56:57 GMT
From: "Mark Riehl" <mark.riehl@agilecommunications.com>
Subject: Re: How to get Mac and IP address of computers over a network?
Message-Id: <d_Pc7.1265$cv6.477362@typhoon1.gnilink.net>

Are the target machines SNMP capable?  How about using the Perl SNMP module?

Mark


"Robert Sherman" <rsherman@ce.gatech.edu> wrote in message
news:3B727159.8EB02193@ce.gatech.edu...
> Fred wrote:
> >
> > helgi@NOSPAMdecode.is (Helgi Briem) wrote in message
news:<3b727bba.1481552429@news.isholf.is>...
> > > The command ipconfig /all can be used to get network info
> > > on a NT box so you can try:
> > >
> > > my @network_info = qx/ipconfig \/all/
> > > or die "Cannot run ipconfig:$?\n";
> > > print @network_info;
> >
> > Thanks Helgi that does work, but it only works for getting the info on
> > my machine.  I need to get the IP and Mac addresses of other machines
> > on the network as well.  It appears to me that ipconfig cannot be used
> > for this.  If I am overlooking something that you wrote and it can be
> > used for getting other's info or if you know of a way to get other's
> > info as well please let me know.
> > Thanks again,
> >
> > Fred
>
> NBTScan is a nice tool for getting netbios info and mac addresses from
> windows boxes...and there is a perl version, which might help you out:
>
> http://www.inetcat.org/software/nbtscan.txt
>
> though it does seem all it really does is ping and arp, then parse the
> results...
>
> --
> robert sherman
> css, cee
> georgia institute of technology
> atlanta, ga, usa




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

Date: Fri, 10 Aug 2001 12:25:42 GMT
From: helgi@NOSPAMdecode.is (Helgi Briem)
Subject: Re: How to get Mac and IP address of computers over a network?
Message-Id: <3b73d221.1569214461@news.isholf.is>

On 9 Aug 2001 10:42:49 -0700, flichtenfels@hotmail.com
(Fred) wrote:

>helgi@NOSPAMdecode.is (Helgi Briem) wrote in message news:<3b727bba.1481552429@news.isholf.is>...
>> The command ipconfig /all can be used to get network info
>> on a NT box so you can try:
>> 
>> my @network_info = qx/ipconfig \/all/ 
>> or die "Cannot run ipconfig:$?\n";
>> print @network_info;
>
>Thanks Helgi that does work, but it only works for getting the info on
>my machine.  I need to get the IP and Mac addresses of other machines
>on the network as well.  It appears to me that ipconfig cannot be used
>for this.  If I am overlooking something that you wrote and it can be
>used for getting other's info or if you know of a way to get other's
>info as well please let me know.
>Thanks again,
>
For remote machines use 
nbtstat -a COMPUTERNAME or
nbtstat -A IP_ADDRESS

The information returned is less complete than
ipconfig, but does contain IP, name and MAC address.

These are not really Perl questions although I guess
there must be a native Perl way of retrieving this
info, so I suggest an NT admin newsgroup for
further discussion of this topic.

Regards,
Helgi Briem



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

Date: Fri, 10 Aug 2001 12:33:32 +0100
From: "Bell, Leslie" <lbell@essex.ac.uk>
Subject: how to get perlscript
Message-Id: <C402F529148ED411A7FF00A0C9DD67E10DE17E1A@sernt14.essex.ac.uk>

Thanks for the help.





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

Date: 10 Aug 2001 12:34:05 GMT
From: Tina Mueller <tinamue@zedat.fu-berlin.de>
Subject: Re: Is an element in a table ?
Message-Id: <9l0kbt$6qee0$2@fu-berlin.de>

Philippe PERRIN <philippe.perrin@sxb.bsf.alcatel.fr> wrote:
> Here is my solution... there must be better :

> $n = 0;
> foreach (@listA) { # if @listA is smaller
>    $n += grep(/^$_$/, @listB);
> }

02:21pm tina.mueller@lolland tina.mueller > perl -wle'
@a = qw(a bc d g l pm i q);
@b = qw(k m tz up d g wq l);
$n = 0;
foreach (@a) {                           
   $n += grep(/^$_$/, @b);
}
print $n'
64

hmm....
$_ is the innermost variable, so in this case you're comparing
equal values everytime.
you 
foreach my $p (@a) {
 $n += grep(/^$p$/, @b);
}

but you're going through the arrays in O(n^2).
that can be made quicker:

my %seen;
my $n=0;
@seen{@a}=(1)x@a;
for (@b) {
  $n++ unless --$seen{$_}
}; 

> plop740@mail.ru wrote:
>> 
>> I have 2 lists of data: list A and list B
>> 
>> What's the quickest way to see if, and how many elements of A are in B
>> ?

regards,
tina

-- 
http://www.tinita.de \  enter__| |__the___ _ _ ___
tina's moviedatabase  \     / _` / _ \/ _ \ '_(_-< of
search & add comments  \    \ _,_\ __/\ __/_| /__/ perception
---   Warning: content of homepage hopelessly out-dated   ---


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

Date: Fri, 10 Aug 2001 12:23:42 GMT
From: flamencoman@earthlink.net
Subject: Re: Is this a Perl bug?
Message-Id: <3b77d232.25711888@news.earthlink.net>

On Fri, 10 Aug 2001 18:44:20 +1000, mgjv@tradingpost.com.au (Martien
Verbruggen) wrote:

>Subject: Re: Is this a Perl bug?
>
>I think you have a bug in your newsreader:
>
>On Fri, 10 Aug 2001 07:14:40 GMT,
>	flamencoman@earthlink.net <flamencoman@earthlink.net> wrote:
>> 
>> ----=_3b7389fd72248580250c5a4.MFSBCHJLHS
>> Content-Type: text/plain; charset=us-ascii
>> Content-Transfer-Encoding: 7bit
>
>you posted unreadable crap to clp.misc. Please don't do this again. if
>you want to post a program, post its source code as part of the message
>body. Do not post multipart MIME attachments.
>
>Martien
Martien,

I apologize to you and any one else who reads this. In the future I
will post everything in the body of the email.

Thanks,
Flamencoman


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

Date: Fri, 10 Aug 2001 12:30:48 GMT
From: flamencoman@earthlink.net
Subject: Re: Is this a Perl bug?
Message-Id: <3b79d425.26211293@news.earthlink.net>

On Fri, 10 Aug 2001 04:44:13 -0400, Samneric
<samneric@tigerriverOMIT-THIS.com> wrote:

>flamencoman@earthlink.net wrote:
>> I don't get it. Why does Perl balk when it sees this long string. I've
>> included both the perl script and the html file as attachments. I have
>> run this on Windows98, Windows2000, and UNIX with the same result.
>
>It's not a perl bug. You told perl to skip this VERY long line (no lf's,
>cr's).
>The line in question begins:   CLASS="Code"><!-- $MVD$:spaceretainer()
>--> 
>
>You told perl to skip it when you wrote this line of code:
> if($curr =~ /<!-- \$MVD\$/i){next;}
>
>You evidently intended that line of code to only be applied between the
><HEAD>..</HEAD> tags, but like all "buggy" programming languages perl
>does what you told it to do - not what you intended it to do :)
>
>BTW, there is no <\HEAD> tag in HTML.
Oh oh, I wasn't expecting the <!--$MVD$.. line to occur anywhere else
than in the top part of the file between the <HEAD>...</HEAD>
components. I was just totally blind to it.

I have rewritten this by setting a flag as soon as <HEAD> is
encountered and use the flag to throw away the lines I don't want. I
turn the flag off when I encounter </HEAD> in case there are any more
of those <!--$MVD$ tags anywhere else in the file.

Thanks for your speedy reply and spotting my error.

Flamencoman


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

Date: 10 Aug 2001 11:59:02 GMT
From: hakonrk@fys.uio.no (Haakon Riiser)
Subject: Learning Perl, 2nd Edition
Message-Id: <slrn9n7j46.9k.hakonrk@s.hn.org>

I recently bought this book, and discovered shortly after that it had
been obsoleted by the 3rd edition.  Are the changes in the 3rd edition
significant?  I am thinking about returning the book, but I won't make
a decision until I know if the changes are relevant to me.

-- 
 Haakon


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

Date: 10 Aug 2001 05:23:55 -0700
From: merlyn@stonehenge.com (Randal L. Schwartz)
Subject: Re: Learning Perl, 2nd Edition
Message-Id: <m1pua4gl2c.fsf@halfdome.holdit.com>

>>>>> "Haakon" == Haakon Riiser <hakonrk@fys.uio.no> writes:

Haakon> I recently bought this book, and discovered shortly after that
Haakon> it had been obsoleted by the 3rd edition.  Are the changes in
Haakon> the 3rd edition significant?  I am thinking about returning
Haakon> the book, but I won't make a decision until I know if the
Haakon> changes are relevant to me.

Hmm.  I can argue for both.  The new third-edition llama is derived
from our current Stonehenge courseware, and our courseware was derived
from the first edition of the llama (with about a dozen major
revisions over the past seven years).  There's no cut-n-paste between
the two books, because it lept media instead.  We've learned from
watching students reactions how to talk about certain difficult
subjects, like regular expressions and why it's not @a[3], and that's
reflected in the new book organization and content.  So, while the
first edition llama has recieved much praise for being easy to read,
I'd say this third edition stands head and shoulders above that.

-- 
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!


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

Date: 10 Aug 2001 10:20:01 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: Location: cgi problem
Message-Id: <9l0cgh$abe$2@mamenchi.zrz.TU-Berlin.DE>

According to Richard Chamberlain  <richard@SPAMsunsetandlabrea.com>:

[...]

> > No URL?  No code?  Wrong group?  With the greatest of respect, it's
> > very hard to help someone who doesn't seem to be trying very hard to
> > help their helpers.  The crystal ball is in the workshop right now,
> > and the initial diagnosis is usenet exhaustion.
 
[...]

> Sometimes I wonder why people expend so much energy insulting people if 
> they post to the wrong group instead of just saying 'try posting here'. You 
> first paragraph was perfect - the rest >> With the greatest of respect - 
> was just annoying.

This is Usenet, not your personal help desk.

Your post -- off topic for clpm, and devoid of diagnosable content
for any group -- annoyed a lot of people.  Expect to be annoyed back.

Anno


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

Date: Fri, 10 Aug 2001 13:08:12 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Newsletter Script
Message-Id: <k2g7nt4h1c1rblhqsta7di291vodmlmp4t@4ax.com>

On Fri, 10 Aug 2001, "Sgluarb" <ommadawn@club-internet.fr> wrote:
>Somebody have a newsletter script to send mail ( with text  and HTML) ?
>
>PS1: Our NewsLetter email list is about 10 000 persons
>PS2: ActivePerl 5.6

Something tells me that about 10 000 people will be very happy if
there's no answer to this question.

SCNR,
-- 
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.


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

Date: Fri, 10 Aug 2001 12:54:49 +0200
From: "B. Caligari" <bcaligari@fireforged.com>
Subject: Re: Newsletter Script
Message-Id: <9l0e9c02nnr@enews2.newsguy.com>


"Sgluarb" <ommadawn@club-internet.fr> wrote in message
news:9l0b2l$im3$1@reader1.imaginet.fr...
> Hi,
>
> Somebody have a newsletter script to send mail ( with text  and HTML) ?
>
> PS1: Our NewsLetter email list is about 10 000 persons
> PS2: ActivePerl 5.6
>

http://www.google.com/search?q=perl+newsletter+script




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

Date: Fri, 10 Aug 2001 14:07:48 +0100
From: "Sgluarb" <ommadawn@club-internet.fr>
Subject: Re: Newsletter Script
Message-Id: <9l0irc$l23$1@reader1.imaginet.fr>

"Thomas Bätzler"

> >PS1: Our NewsLetter email list is about 10 000 persons
> >PS2: ActivePerl 5.6
>
> Something tells me that about 10 000 people will be very happy if
> there's no answer to this question.

No, no that's not a spam list... 8-|

That's just a newletter for who subscribe for tit.
It already exist but i've made it in PHP / MySQL. I want to make it in perl
or python and i'm searching for sources that inspire me.

Sorry for ma really bad english

I found this, but that's not i really want http://listes.cru.fr/sympa/




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

Date: 10 Aug 2001 12:07:51 GMT
From: anno4000@lublin.zrz.tu-berlin.de (Anno Siegel)
Subject: Re: permuting extremely large string
Message-Id: <9l0iqn$k1c$1@mamenchi.zrz.TU-Berlin.DE>

According to Les Ander  <citykid@nospam.edu>:
> Hi,
> i need to permute a string which is about 4 Mb!
> I experience  memory problems if i convert it to an array (the program
> crashes). So I need to permute the string inplace without converting
> it into an array.
> A simple strategy i am thinking of is follows...
> 
> sub perm_string
> {
>   my $str_ref=shift @_;
>   my $len=length $$str_ref;
>   for (1..1000){
>      my $start=int rand($len-1);
>      my $size=int rand($len-$start-1);
>      my $temp_str=substr($$str_ref, $start,$size);
>      substr($$str_ref, $start, $size)='';
>      $$str_ref.=$temp_str;
>   }
> }
> 
> it took about 45 seconds when i tried it on a string of length about
> 5,000,0000 characters.
> Is there a way to speed it up?
> also, can some one think of a better algorithm?

Well, your method will scramble the string royally, but I doubt it
will give you a random permutation.  I'd expect it to leave intact
more short sub-sequences than it should.

If randomness really matters, use the Fisher/Yates algorithm
(described in "perldoc -q shuffle") and rewrite it to use substrings
of length 1, or even vec( $string, $i, 8), instead of array elements.
That will probably be much slower than your relaxed algorithm, but
it will give you an idea what it costs to shuffle an array that
size.

Anno


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

Date: Fri, 10 Aug 2001 13:06:25 +0200
From: =?ISO-8859-1?Q?Thomas_B=E4tzler?= <Thomas@Baetzler.de>
Subject: Re: Reading a NT directory from Unix
Message-Id: <umf7nt4cidujvejvv005mf7ge8c5a45nml@4ax.com>

Hi,

On Fri, 10 Aug 2001, ahz.ReMoVe@aub.auc.dk (Anders Hertz) wrote:
>What modules should I look further upon if I have to do the following:
>
>Checking if a file exists on a machine running Windows NT Workstation.
>The file is in a shared directory (maybe also reading it could be
>necessary).

From a Perl p.o.v. you do not need any modules - the file tests should
work just fine if you have mounted the NT volumes correctly. Getting
that done is not a Perl problem and as such not part of the scope of
this group. Hint: If you're running Linux, check out smbmount.

HTH,
-- 
Thomas Baetzler - http://baetzler.de/ - Clan LoL - http://lavabackflips.de/
I am the "ILOVEGNU" signature virus. Just copy me to your signature.
This post was infected under the terms of the GNU General Public License.


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

Date: Fri, 10 Aug 2001 12:55:50 GMT
From: "Scaramouche" <e.quesada@verizon.net>
Subject: telnet session through perl
Message-Id: <qRQc7.335$1i.68614@paloalto-snr1.gtei.net>

i'm attempting to create an html page that'll list a number of ip addresses.
my goal is to allow (intranet) users to click on these hyperlinks, pass the
specific ipaddress as the 'QUERY_STRING' value, to a script that'll in turn
kick off a telnet session to that specific ipaddress.
i've not been successful with a c++ script i wrote.  it doesn't error out,
but ms telnet is not being executed for whatever the reason.  the
'QUERY_STRING' value however, is on the money.
although i'm a perl newbie i'm thinking perl would be a good option for
this.
is perl a feasible choice for this type of action? would someone point me in
the right direction ?
below is an example of what i've tried w/out success:

$ip_address = $ENV{'QUERY_STRING'};
print "$ip_address"; #debug purposes
system("telnet $ip_address"); #nothing happens here. no error msgs no
telnet.

thanks,
rick





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

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


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