[19558] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 1753 Volume: 10

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Sat Sep 15 21:05:43 2001

Date: Sat, 15 Sep 2001 18:05:07 -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: <1000602307-v10-i1753@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Sat, 15 Sep 2001     Volume: 10 Number: 1753

Today's topics:
    Re: a mystery to me: EOF (Trewth Seeker)
    Re: Do I need file locking <joe+usenet@sunstarsys.com>
    Re: Do I need file locking (Martien Verbruggen)
    Re: Do I need file locking <joe+usenet@sunstarsys.com>
        foreach problem ? <w.nagele@permedia.at>
    Re: foreach problem ? <dtweed@acm.org>
    Re: foreach problem ? <w.nagele@permedia.at>
    Re: Image dimension (Martien Verbruggen)
        Mail parser: Can it be faster? <newspost@coppit.org>
    Re: Mail parser: Can it be faster? <newspost@coppit.org>
    Re: Need help please... <NOSPAM!REMOVEME!!me_gill@hotmail.com>
    Re: Perl (slurping) is TOO much fun <joe+usenet@sunstarsys.com>
    Re: Please help, It did'nt help. <Kalle Anka@markisspecialisten.com>
    Re: Please help, It did'nt help. <Laocoon@eudoramail.com>
    Re: process stopping --> start script <luke@chipcity.com.au>
        Reading cookies from a different path <steveeq2@tripperjones.com>
    Re: Reading cookies from a different path (Malcolm Dew-Jones)
    Re: Recommendations for a PERL editor (Tim Hammerquist)
    Re: Similar file finder <sun_tong@users.sourceforge.net>
        Thank you <faithlezz@hotmail.com>
        Digest Administrivia (Last modified: 6 Apr 01) (Perl-Users-Digest Admin)

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

Date: 15 Sep 2001 15:19:50 -0700
From: trewth_seeker@yahoo.com (Trewth Seeker)
Subject: Re: a mystery to me: EOF
Message-Id: <d690a633.0109151419.2aa2ff48@posting.google.com>

Ilya Zakharevich <nospam-abuse@ilyaz.org> wrote in message news:<9nl8k1$v0l$1@agate.berkeley.edu>...
> [A complimentary Cc of this posting was sent to
> Trewth Seeker
> <trewth_seeker@yahoo.com>], who wrote in article <d690a633.0109061741.2fdb750f@posting.google.com>:
> > > > For plain files, read will always return the number of bytes that the
> > > > programmer requested,
> > > 
> > > Nope,
> > 
> > One should be quite sure before naysaying someone.
> 
> I do.
> 
> > The context of Mark's remark was set by Juha Laiho's
> > "F.ex. on Unix systems," -- EMX is not a Unix system.
> 
> Mark's remark is context-free.

What an utterly idiotic statement.
 
> Ilya


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

Date: 15 Sep 2001 15:07:08 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Do I need file locking
Message-Id: <m34rq45l43.fsf@mumonkan.sunstarsys.com>

mgjv@tradingpost.com.au (Martien Verbruggen) writes:

> On Sat, 15 Sep 2001 10:26:55 GMT,
> 	Bart Lateur <bart.lateur@skynet.be> wrote:
>
> > Too many sys* words.
> > 
> > So why is there a sysseek() anyway?
> 
> History, I presume.
> 
> >                                     There isn't a systell().
> 
> probably because there is no ltell(2).

Nor is there a need for one- lseek(2) returns the current position
as does sysseek, so (in C) "ltell(fd)" = lseek( fd, 0, SEEK_CUR).

-- 
Joe Schaefer    "In order to form an immaculate member of a flock of sheep one
                                must, above all, be a sheep."
                                               --Albert Einstein



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

Date: Sun, 16 Sep 2001 08:23:40 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Do I need file locking
Message-Id: <slrn9q7l7c.bfe.mgjv@martien.heliotrope.home>

On 15 Sep 2001 15:07:08 -0400,
	Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> 
>> On Sat, 15 Sep 2001 10:26:55 GMT,
>> 	Bart Lateur <bart.lateur@skynet.be> wrote:
>>
>> > Too many sys* words.
>> > 
>> > So why is there a sysseek() anyway?
>> 
>> History, I presume.
>> 
>> >                                     There isn't a systell().
>> 
>> probably because there is no ltell(2).
> 
> Nor is there a need for one- lseek(2) returns the current position
> as does sysseek, so (in C) "ltell(fd)" = lseek( fd, 0, SEEK_CUR).

Euhmm.. I wasn't suggesting that there should be an ltell, just
remarking that it doesn't exist. I am pretty sure I knew that lseek
returns the file offset before you told me :)

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Begin at the beginning and go on till
Commercial Dynamics Pty. Ltd.   | you come to the end; then stop.
NSW, Australia                  | 


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

Date: 15 Sep 2001 19:24:48 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Do I need file locking
Message-Id: <m3vgik3um7.fsf@mumonkan.sunstarsys.com>

mgjv@tradingpost.com.au (Martien Verbruggen) writes:

> On 15 Sep 2001 15:07:08 -0400,
> 	Joe Schaefer <joe+usenet@sunstarsys.com> wrote:
> > mgjv@tradingpost.com.au (Martien Verbruggen) writes:
> > 
> >> 
> >> probably because there is no ltell(2).
> > 
> > Nor is there a need for one- lseek(2) returns the current position
> > as does sysseek, so (in C) "ltell(fd)" = lseek( fd, 0, SEEK_CUR).
> 
> Euhmm.. I wasn't suggesting that there should be an ltell, just
> remarking that it doesn't exist. I am pretty sure I knew that lseek
> returns the file offset before you told me :)

Ah- sorry.  Unlike you, I'm quite certain I knew you knew ;)  Just 
stating the obvious for those not equipped with an lseek(2) manpage 
(although in retrospect Perl's sysseek documentation basically says 
the same thing).

-- 
Joe Schaefer               "The inevitable catastrophe is at hand."
                                               -- Edgar Allen Poe



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

Date: Sat, 15 Sep 2001 20:57:04 +0200
From: "[per media] Wolfgang Nagele" <w.nagele@permedia.at>
Subject: foreach problem ?
Message-Id: <3ba3a4e3$0$9458$6e365a64@newsreader02.highway.telekom.at>

I have the following Code ...

---CUT---
open(TMP_SEND,"<emails.txt");
@tmp_send = <TMP_SEND>;
close TMP_SEND;
foreach $line_tmp_send (@tmp_send) {
    @splitted = split(/\|/, $line_tmp_send);
    use MIME::Lite;
    MIME::Lite->send('smtp', "smtp.netway.at", Timeout => 60);
    $msg = MIME::Lite->new(
        From     => 'vobis@permedia.at',
        To       => $splitted[1],
        Subject  => "$tmp9",
        Type     => 'multipart/related'
    );
    $msg->attach(
        Type  => 'text/html',
        Data  => "<html><body>$tmp10</body></html>"
    );
    $msg->attach(
        Type  => 'application/excel',
        Path  => "$upload_file",
        Id    => 'preisliste.xls',
    );
    $msg->send;
}
---CUT---

First of all i load the file "emails.txt" in which lines with the syntax
"bla1|bla2|..." can be found.
The second step is to pull it through a foreach loop to split every line and
send out an email.
After the split everything is still alright. The data comes out, etc.
Then i use the Module Mime::Lite to send out a mail to the splitted part.
When i pull in everything directly without variables it works!

I don't know any further :-(

Pls help!!!


--------------------------------------------------
Wolfgang Nagele
Technics [per media]
w.nagele@permedia.at
--------------------------------------------------




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

Date: Sat, 15 Sep 2001 19:49:04 GMT
From: Dave Tweed <dtweed@acm.org>
Subject: Re: foreach problem ?
Message-Id: <3BA3AF73.EBA0C01B@acm.org>

"[per media] Wolfgang Nagele" wrote:
> I have the following Code ...

>     use MIME::Lite;

This might as well be outside the loop. After the first iteration,
it's a no-op anyway.

>         To       => $splitted[1],

Are you sure this is the correct (second) field on the line?

>         Subject  => "$tmp9",
and
>         Path  => "$upload_file",

The quotes are unnecessary here.

> When i pull in everything directly without variables it works!
> I don't know any further :-(

Without any clues as to how it fails, it's difficult to help you.
Go back to the version that works, then make one change at a time
until it breaks, then make sure you know what the error message
(if any) means.

-- Dave Tweed


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

Date: Sun, 16 Sep 2001 00:51:58 +0200
From: "[per media] Wolfgang Nagele" <w.nagele@permedia.at>
Subject: Re: foreach problem ?
Message-Id: <3ba3dbf0$0$7226$6e365a64@newsreader02.highway.telekom.at>

> "[per media] Wolfgang Nagele" wrote:
> > I have the following Code ...
>
> >     use MIME::Lite;
>
> This might as well be outside the loop. After the first iteration,
> it's a no-op anyway.
i also tested this way ...

> >         To       => $splitted[1],
>
> Are you sure this is the correct (second) field on the line?
yeah it's right ...

> >         Subject  => "$tmp9",
> and
> >         Path  => "$upload_file",
>
> The quotes are unnecessary here.
okay

> > When i pull in everything directly without variables it works!
> > I don't know any further :-(
>
> Without any clues as to how it fails, it's difficult to help you.
> Go back to the version that works, then make one change at a time
> until it breaks, then make sure you know what the error message
> (if any) means.
i don't get any error from the skript thats the problem :)




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

Date: Sun, 16 Sep 2001 08:27:23 +1000
From: mgjv@tradingpost.com.au (Martien Verbruggen)
Subject: Re: Image dimension
Message-Id: <slrn9q7leb.bfe.mgjv@martien.heliotrope.home>

On Sat, 15 Sep 2001 17:21:52 +0200,
	Primo <primo.lgz@tiscalinet.it> wrote:
> How I do to know the dimensions of an immage (eg. width=468 height=60)
> without use of modules?

See my answer in clp.modules. And, the next time you post the same
question to two newsgroups, use the crossposting facilities on your
newsreader.

Martien
-- 
Martien Verbruggen              | 
Interactive Media Division      | Useful Statistic: 75% of the people
Commercial Dynamics Pty. Ltd.   | make up 3/4 of the population.
NSW, Australia                  | 


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

Date: Sat, 15 Sep 2001 18:27:25 -0400
From: David Coppit <newspost@coppit.org>
Subject: Mail parser: Can it be faster?
Message-Id: <3BA3D5CD.1090608@coppit.org>

Hi all,

I'm the author of grepmail (http://grepmail.sf.net/). Over the years 
I've gotten it to be fairly fast, but the primary bottleneck in grepmail 
is still parsing the mbox-style mailbox file. The algorithm is a little 
complicated because I try to identify unquoted "From" lines that are 
part of included messages. However, I only touch any line in the file once.

I've reimplemented the algorithm using Inline::C (uber-cool!) to get 
about a 30% speedup, depending on the machine. I've also tried various 
tweaks like sysread to get it to go faster, but haven't seen any 
improvement. (I even tried adapting the odd memory allocation scheme in 
GNU grep for my C implementation--I think it tries to allocate on page 
boundaries or something.)

Can anyone suggest techniques to get this code to run faster? The 
interface should stay basically the same (status, email scalar, line 
number), but you can maybe exploit the fact that this isn't a random 
access read.

Thanks,
David

-----------Begin code----------------
use FileHandle;

die "usage: $0 mailbox\n" unless @ARGV;

my $LINE = 0;
my $FILE_HANDLE = new FileHandle($ARGV[0]);

my $count = 0;

while(1)
{
   my ($status,$email,$line) = read_email();
   last unless $status == 1;

   $count++;
};

print "$count emails parsed\n";

exit;

# ---------------------------------------------------------------------

# Need this for a lookahead.
my $NEXT_EMAIL = undef;

sub read_email
{
   local $/ = "\nFrom ";

   # Empty file means reset first email and return 0
   if (!defined $NEXT_EMAIL && eof $FILE_HANDLE)
   {
     $LINE = 0;
     return 0;
   }

   $LINE++ if $LINE == 0;

   my $email;
   my $line;

   if (defined $NEXT_EMAIL)
   {
     $email = $NEXT_EMAIL;
     $line = $LINE;
     $LINE += ($NEXT_EMAIL =~ tr/\n//);
     undef $NEXT_EMAIL;
   }
   else
   {
     $email = <$FILE_HANDLE>;
     $line = $LINE;
     $LINE += ($email =~ tr/\n//);

     local $/ = "From ";
     chomp $email;
   }

   while(1)
   {
     $NEXT_EMAIL = <$FILE_HANDLE>;

     last unless defined $NEXT_EMAIL;

     local $/ = "From ";
     chomp $NEXT_EMAIL;
     substr($NEXT_EMAIL,0,0) = 'From ';

     # See if we accidentally stopped on an unescaped "From my mother".
     if ($NEXT_EMAIL !~ /^From\s.*\d:\d+:\d.* \d{4}/)
     {
       $email .= $NEXT_EMAIL;
       $LINE += ($NEXT_EMAIL =~ tr/\n//);
       undef $NEXT_EMAIL;
       redo;
     }

     # There is more to this email if the end is a Begin Included
     # Message Reverse the email before searching (for efficiency).
     # This is just as fast as index(). (Even after taking the last 200
     # characters as a substring.)
     my $end_of_string = substr($email,-200);

     # Sorry about the word wrap here if you get it
     if ($end_of_string =~ /\n-----( Begin Included Message |Original 
Message)-----\n[^\n]*\n*$/i)
     {
       $email .= $NEXT_EMAIL;
       $LINE += ($NEXT_EMAIL =~ tr/\n//);
       undef $NEXT_EMAIL;
       redo;
     }

     last;
   }

   return (1,$email,$line);
}

------------End code-----------------



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

Date: Sat, 15 Sep 2001 18:39:48 -0400
From: David Coppit <newspost@coppit.org>
Subject: Re: Mail parser: Can it be faster?
Message-Id: <3BA3D8B4.4070902@coppit.org>

I should probably mention that the file handle could be STDIN, and that 
the emails may be printed between reads. Some emails can get fairly 
large because of 2MB PowerPoint attachments. :)

David



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

Date: Sat, 15 Sep 2001 13:57:48 -0500
From: "Michael Gill" <NOSPAM!REMOVEME!!me_gill@hotmail.com>
Subject: Re: Need help please...
Message-Id: <3ba3a422@news.wworld.com>

Believe it or not, that worked.  =)  Thanks

Logan Shaw <logan@cs.utexas.edu> wrote in message
news:9ntopk$5ib$1@charity.cs.utexas.edu...
> In article <3ba263e9@news.wworld.com>,
> Michael Gill <me_gill@hotmail.com> wrote:
> >the code.  What I'm wanting to do is set that variable equal to
> >"http://myserver.com/scripts/foxisapi.dll/server.enging.uploadcomplete?"
+
> >FileNameVariable
> >The current code only allows for the part in quotes.
>
> If I run this Perl code:
>
> $foo = "abc";
> $bar = "123";
>
> $foo .= $bar;
>
> print $foo;
>
> I get "abc123" as the output.
>
> Actually, though, in your case this is not the right thing to do,
> because if that variable has funny characters in it that have a
> special meaning in a URL (like "?", "&", and so on), then your
> variable will contain the wrong URL to pass that information along.
> So, you want to use something to escape those special characters.
>
> Unfortunately, I'm not a big web programmer, so I don't know
> what the proper technique is, but I know that there is at least
> one module that does this for you.  If your environment is set
> up for web development, you may already have such a module
> available.  If not, you could probably download and install
> URI::Escape.  See http://search.cpan.org/search?dist=URI .
>
>   - Logan
> --
> "Our grandkids love that we get Roadrunner and digital cable."
> (Advertisement for Time Warner cable TV and internet access, July 2001)




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

Date: 15 Sep 2001 16:27:15 -0400
From: Joe Schaefer <joe+usenet@sunstarsys.com>
Subject: Re: Perl (slurping) is TOO much fun
Message-Id: <m3zo7w42u4.fsf@mumonkan.sunstarsys.com>

logan@cs.utexas.edu (Logan Shaw) writes:

> Is there an easy tie() equivalent for this?
> 
> 	@foo = <FOO>;
> 	
> 	# munge @foo to your satisfaction
> 
> 	seek FOO, 0, 0;
> 	print FOO @foo;

DB_File with $DB_RECNO provides an alternative for this,
but the massive IO (one write(2) call for each line ?) 
makes it pretty slow for gigantic files.  There might
be some setting that buffers the writes, but I don't 
know how to do it.

-- 
Joe Schaefer     "A man cannot be too careful in the choice of his enemies."
                                               --Oscar Wilde



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

Date: Sat, 15 Sep 2001 21:01:10 GMT
From: "Kalle Anka" <Kalle Anka@markisspecialisten.com>
Subject: Re: Please help, It did'nt help.
Message-Id: <qkPo7.4943$sn6.530183@newsc.telia.net>

IT ONLY ERASED THE MAIL-FILE

#!/usr/bin/perl -w

use CGI qw(:standard);

$filename = "/home/markisspecialisten/www/guestmail.htm";
$backupfile = "/home/markisspecialisten/www/backup.html";
$recipient = 'radera@markisspecialisten.com';

$q = CGI->new();
$email = $q->param( "email" );

print $q->header();
print $q->start_html('Resultat av kommando');
print $q->h1('Resultat av kommando');
(&cleanup); # Kjør sub og skriv returnert verdi.
print $q->end_html();
print "\n";

sub cleanup {

  if ($email =~ tr/*?//d) {
print "Du har angivit en otillåten e-post address!<br>\n\n";
print qq {<a href="../remove.htm" target="_top">Försök igen!</a>\n} ;
} else{


    open INFILE, $filename
or return "Couldn't open file for reading";
    @infile = <INFILE>;
    close INFILE;

if ( $email =~ /^\s*$/ ) {
print "Skriv in din e-postadress för att ta bort den från vår lista.<br>\n"
;
print qq {<a href="../remove.htm" target="_top">Försök igen!</a>\n} ;
exit ;
}


open INFILE, $filename or die "Can't open '$filename': $!";

$line;
  while (<INFILE>) {
    chomp; # drops trailing newlines; can omit if undesirable
    $line = $_, last if /^\Q$email/i && ! /^$/; # substr match!
  }

  close INFILE;
  print "Din e-postadress fanns med i vår lista och är nu
borttagen.<br>\n\n" if defined $line;

  print "Din e-postadress fanns inte med i vår lista.<br>\n\n" unless
defined $line;
  print qq {<a href="../remove.htm" target="_top">Försök igen</a>\n} unless
defined $line;
  print " och kontrollera om det är rätt e-postadress du erhållit vår
information på.<br>\n\n" unless defined $line;
  print "Var noga med att ange små och stora bokstäver.<br><br>\n\n" unless
defined $line;
  print "Kontakta oss på " unless defined $line;
  print qq {<a href="mailto:radera@} unless defined $line;
  print qq {markisspecialisten.com">radera@} unless defined $line;
  print qq {markisspecialisten.com</a>\n} unless defined $line;
  print " om problemet kvarstår." unless defined $line;




    open BACKUP, ">$backupfile"
or return "Couldn't make backup of original file";

    if (@infile) { # Sjekk om den er tom
for $line (@infile) {
    print BACKUP $line;
}
    }

    open OUTFILE, ">$filename"
or return "Couldn't open file for writing";
for $line (@infile) {
 print OUTFILE $line =~ s/$email\n//;




}


   close OUTFILE;


}
}




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

Date: Sun, 16 Sep 2001 02:16:50 +0200
From: Laocoon <Laocoon@eudoramail.com>
Subject: Re: Please help, It did'nt help.
Message-Id: <Xns911E18AA921EFLaocooneudoramail@62.153.159.134>

*snip* 
>     open OUTFILE, ">$filename"
> or return "Couldn't open file for writing";
> for $line (@infile) {
>  print OUTFILE $line =~ s/$email\n//;
*snip*

$line =~s/$email\n//;
print OUTFILE $line;

Why didn't u say its in a loop?

for (@infile) {
next if /$email/;
print OUTFILE $line;
}


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

Date: Sun, 16 Sep 2001 05:53:04 +0930
From: Luke Vanderfluit <luke@chipcity.com.au>
Subject: Re: process stopping --> start script
Message-Id: <3BA3B8A8.EC31EF76@chipcity.com.au>

Hi,

I can't get this working
I've simplified the script to:

#!/usr/bin/perl

use IPC::Open3;
open(DEVNULL, "<", "/dev/null");
my $s = open3(">&STDOUT", "<&DEVNULL", ">&STDERR", "keepLinkUp");
print $s;

the os complains that open has too many arguments.

can anyone help?

L.


>
>         use IPC::Open3;
>         open(DEVNULL, "<", "/dev/null");
>         my $s = open3(">&STDOUT", "<&DEVNULL", ">&STDERR", "squid");
>         system("/etc/rc.d/rc.firewall");
>         system("/etc/rc.d/init.d/smb start");
>         open(DEVNULL, "<", "/dev/null");
>         my $w = open3(">&STDOUT", "<&DEVNULL", ">&STDERR", "wvdial");
>         sleep 10*60;
>         open(DEVNULL, "<+", "/dev/null");
>         my $k = open3(">&DEVNULL", "<&DEVNULL", ">&STDERR",
>                 "keepLinkUp");
>         my $pid = wait or die "wait: $!";
>         if( $pid == $s ) {
>                 die "Uh oh, squid died\n"
>         } elsif( $pid == $k ) {
>                 die "Uh oh, keepLinkup died\n";
>         } elsif( $pid != $w ) {
>                 die "Urk, got $pid, expected one of $s, $w, $k\n";
>         }
>         kill "TERM", $k;
>
> --

--
                           Lo que ves es lo que obtienes

                           Luke Vanderfluit
 [if no image, click here]
                           Phone 61 8 8556 6112

                           Aldinga Beach, South Australia






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

Date: Sat, 15 Sep 2001 13:30:34 -0700
From: "Steve Quezadas" <steveeq2@tripperjones.com>
Subject: Reading cookies from a different path
Message-Id: <3ba3b9d2_6@goliath.newsgroups.com>

Does anyone know how to read cookies that exist on a different path? My perl
script is in /cgi-bin, but I want to read a cookie that was left by another
program in path: /vegas.

I am using CGI.pm. Here is my greatly simplified code:

#! /usr/bin/perl
use CGI qw(:standard);
@value = cookie(-name=>'vegas',-path=>'/vegas');
print header(-type=>'text/plain');
print $value[0];


It never prints out the value of the cookie! Anyonw know if I am missing
anything? or am I forced to run the program in directory /vegas?

- Steve




-----=  Posted via Newsfeeds.Com, Uncensored Usenet News  =-----
http://www.newsfeeds.com - The #1 Newsgroup Service in the World!
 Check out our new Unlimited Server. No Download or Time Limits!
-----==  Over 80,000 Newsgroups - 19 Different Servers!  ==-----


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

Date: 15 Sep 2001 17:20:26 -0800
From: yf110@vtn1.victoria.tc.ca (Malcolm Dew-Jones)
Subject: Re: Reading cookies from a different path
Message-Id: <3ba3f04a@news.victoria.tc.ca>

Steve Quezadas (steveeq2@tripperjones.com) wrote:
: Does anyone know how to read cookies that exist on a different path? My perl
: script is in /cgi-bin, but I want to read a cookie that was left by another
: program in path: /vegas.

I don't think the browser will send you any cookies except those for your
path or the higher up paths.  Therefore it is impossible to see them no
matter what you do.

I.e. if your script path is /stuff/cgi-bin then the browser will only send
those cookies with a cookie path of /stuff/cgi-bin, /stuff, and / (and if
there is more than one cookie with the same name then it sends the cookie
with the deeper path). 

(There are two paths here.  The path to your script as seen by a browser
and the path that's set as part of the cookie mechanism.  When you set the
cookie you choose its path, but I believe you can only choose a cookie
path that is your script's path or its or higher ups - I've never checked
this though).

I beleive therefore, that if a cookie is set to the path /vegas, then a
script in /cgi-bin can never see the /vegas cookie.  The thing that sets
the /vegas cookie will have to set it as a / cookie instead if the
/cgi-bin scripts are to see the cookie.

Doing this of course means that different scripts start seeing each others
cookies, and so there is the potential for cookie name clash. 

I find it useful to set all cookies to the root , but then incorporate the
path as part of the cookie's name.  All the scripts can see each other's
cookies that way, but still tell each other's cookies apart based on the
naming convention.  The decoder adds and strips the path from the the
cookie name so that the scripts only work with the "real" name portion of
the cookie.  That way the scripts can be moved about without changes
except for the configuration data. 

Of course if you have too many cookies being set by different scripts then
this might become a problem simply due to the volume of cookie data being
passed around for each web page access - Web servers and browsers both
indicate they have limits on the amount of cookie data they can handle at
one time. 



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

Date: Sat, 15 Sep 2001 19:35:53 GMT
From: tim@vegeta.ath.cx (Tim Hammerquist)
Subject: Re: Recommendations for a PERL editor
Message-Id: <slrn9q7c4p.9ro.tim@vegeta.ath.cx>

Me parece que Thomas Bätzler <Thomas@Baetzler.de> dijo:
> On Fri, 14 Sep 2001, tim@vegeta.ath.cx (Tim Hammerquist) wrote:
> >Me parece que Jonadab the Unsightly One <jonadab@bright.net> dijo:
> >> I keep meaning to learn TeX, but I haven't done it yet.  (Meanwhile
> >> my paper-document-production needs are so simple, I could probably
> >> use HTML for that if I didn't have MS Works.)
> 
> >The only drawback I've had with LaTeX is the shortage of online docs. I
> >managed to find a ps version of one doc, and Cambridge U had a decent
> >(though student-oriented) tutorial.
> 
> Have you looked on the Comprehensive TeX Archive Network yet? There's
> a PDF introduction at http://www.ctan.org/starter/?action=/index.html.

No, a Google search didn't turn up CTAN when I was searching for
tutorials.  OTOH, if I add "archive" to the search, it's the first item
in the list.  Thx.  =)

> In any case, I would recommend Helmut Kopka's Guide to LaTeX which is
> available in print from Addison-Wesley or your local library:
> http://www.aw.com/product/0,2627,0201398257,00.html

Yes, that's on my list.  I wasn't going to shell out the cash until I
was sure there wasn't a comparable online ref.  But if the manpage
itself recommends a dead tree reference, I guess I'll grab it.

> But let's get back to Perl...

Yes, let's.  Sorry for rambling. =)

-- 
Is that a 286 or are you just running Windows?


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

Date: 15 Sep 2001 17:23:17 -0300
From: * Tong * <sun_tong@users.sourceforge.net>
Subject: Re: Similar file finder
Message-Id: <sa87kv08aq2.fsf@suntong.personal.users.sourceforge.net>

* Tong * <sun_tong@users.sourceforge.net> writes:

> I'm planing to write a "Similar file finder", which will walks along
> the given dirs to find all similar files within it. 

oh, forgot to mention, I'll probably use the following tools as an
identical file locator:

ch::claudio::finddups - Find duplicate files in given directory

http://www.claudio.ch/Perl/finddups.html

ch::claudio::finddups is a script as well as a package. When called as script
it will search the directory and its subdirectories for files with (possibly)
identical content.

To find identical files fast this program will just remember the Digest::SHA1
hash of each file, and signal two files as equal if their hash matches. It
will output lines that can be given to a bourne shell to compare the two
files, and remove one of them if the comparison indicated that the files are
indeed identical.

Besides that it can be used as a package, and gives so access to the following
variables, routines and methods


Tools get ruled out as my first round sifting:

File::Find::Duplicates - Find duplicate files
http://belfast.pm.org/Modules/Duplicates.html


dupper.pl - finds duplicate files, optionally removes them
http://sial.org/code/perl/scripts/dupper.pl.html


-- 
Tong (remove underscore(s) to reply)
  *niX Power Tools Project: http://xpt.sourceforge.net/
  - All free contribution & collection


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

Date: Sun, 16 Sep 2001 09:24:35 +1000
From: "Kevin" <faithlezz@hotmail.com>
Subject: Thank you
Message-Id: <3ba3e3d2@news.iprimus.com.au>

Thank you for all your help, thanks alot

Kevin

"Kevin" <faithlezz@hotmail.com> wrote in message
news:3ba3487c@news.iprimus.com.au...
> Hi,
>
> I am new to Perl, could some body please help me by explain what are the
> following code means? Thank you very much. Also, what's the different
> between 'local', 'my', 'global' variable?
>
>  1:    sub test {
>  2:        my $type = shift;
>  3:        my $start = shift;
>  4:        my $end = shift || $start;        # What is this line mean?
>  5:        my $class = ref($type) || $type;        # Same as this line
>  6:        my $self = bless {}, $class;
>  7:        my ($key, $value);        # What is this line?
>  8:        local $_ = "";        #What is $_ ?
>  9:
> 10:       eval "/$start/" if defined($start);
> 11:       eval "/$end/" if !$@ && defined($end);        # What is $@ ?
> 12:
> 13:       $key = shift @_;
> 14:        ...
> 15:
> 16:       $self->quote(@_) if @_;
> 17:       return $self;
> 18:    }
>
> Thank you,
> Kevin
>
>
>
>




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

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


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