[16667] in Perl-Users-Digest

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

Perl-Users Digest, Issue: 4079 Volume: 9

daemon@ATHENA.MIT.EDU (Perl-Users Digest)
Mon Aug 21 09:10:35 2000

Date: Mon, 21 Aug 2000 06:10:16 -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: <966863416-v9-i4079@ruby.oce.orst.edu>
Content-Type: text

Perl-Users Digest           Mon, 21 Aug 2000     Volume: 9 Number: 4079

Today's topics:
    Re: PERL file handling srikdvs@my-deja.com
    Re: PERL file handling <lincolnmarr@nospam.europem01.nt.com>
    Re: PERL file handling srikdvs@my-deja.com
        POP3 script in cgi (Roy Pope)
    Re: problems with Tk and NT4 <jemand@klop.com>
    Re: read files from dir then write as csv??? kingofkingston@my-deja.com
        reg exp help a94eribe@my-deja.com
    Re: rookie question: comparing text string to directory <abe@ztreet.demon.nl>
    Re: Running Perl-Script as NT-Service <guenther.degenfelder@datev.de>
        Usning Errno akdwivedi@hotmail.com
    Re: Usning Errno nobull@mail.com
    Re: We Need Your Feedback <panderse@us.ibm.com>
        would you recommend buying a book (Jan Heidbrink)
        Digest Administrivia (Last modified: 16 Sep 99) (Perl-Users-Digest Admin)

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

Date: Mon, 21 Aug 2000 11:12:43 GMT
From: srikdvs@my-deja.com
Subject: Re: PERL file handling
Message-Id: <8nr2r0$181$1@nnrp1.deja.com>

Here is the code for opening the file

   $openFileName = sprintf("%s%s%s", $FLNM_PATH, $czaFileName,
$FLNM_EXTN);

   unless( open(INPUT_FILE, "$openFileName")) # open input file
   {
      system("LogScript $ENV{FOPEN_FAIL} $openFileName");
      exit $ENV{FAILURE};
   }

Thanks


In article <MPG.140b8f19f1e988a59896d3@localhost>,
  jason <elephant@squirrelgroup.com> wrote:
> srikdvs@my-deja.com <srikdvs@my-deja.com> wrote ..
> >I am using a PERL script to split an input file.What is the maximum
> >file size that PERL can handle?When I used a 3.6GB file the script
> >failed.What is the alternative for handling such big files??
>
> how are you handling this input file ? .. and how is it failing ? ..
I'm
> no expert but I wouldn't have thought that the size taken by the
> FILEHANDLE was related in any way to the size of the file that you're
> opening .. meaning that any size of input file could be processed as
> long as it was processed a line at a time (or X lines at a time)
>
> show us some code
>
> --
>   jason -- elephant@squirrelgroup.com --
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 21 Aug 2000 13:17:59 +0200
From: "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com>
Subject: Re: PERL file handling
Message-Id: <8nr34f$13c$1@qnsgh006.europe.nortel.com>


> I am using a PERL script to split an input file.What is the maximum
> file size that PERL can handle?When I used a 3.6GB file the script
> failed.What is the alternative for handling such big files??

Following the philosophy of perl (no limits) the perl itself can handle
whatever you throw at it - the only limit on the size of files you can read
in is the physical amount of memory on the computer. In this case it seems
like your computer is running out of memory (are you sure it's a 3.6
gigabyte file?? That seems damn big to me).
I'm no perl expert myself but I'll assume you are using the diamond operator
to read in the file, line by line. I think there are alternatives to this
but I'm not sure what they are - maybe someone else can help out?




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

Date: Mon, 21 Aug 2000 12:06:58 GMT
From: srikdvs@my-deja.com
Subject: Re: PERL file handling
Message-Id: <8nr60q$4pv$1@nnrp1.deja.com>

Memory is not a problem as the application is running on UNIX box and
not on a PC.


In article <8nr34f$13c$1@qnsgh006.europe.nortel.com>,
  "Lincoln Marr" <lincolnmarr@nospam.europem01.nt.com> wrote:
>
> > I am using a PERL script to split an input file.What is the maximum
> > file size that PERL can handle?When I used a 3.6GB file the script
> > failed.What is the alternative for handling such big files??
>
> Following the philosophy of perl (no limits) the perl itself can
handle
> whatever you throw at it - the only limit on the size of files you can
read
> in is the physical amount of memory on the computer. In this case it
seems
> like your computer is running out of memory (are you sure it's a 3.6
> gigabyte file?? That seems damn big to me).
> I'm no perl expert myself but I'll assume you are using the diamond
operator
> to read in the file, line by line. I think there are alternatives to
this
> but I'm not sure what they are - maybe someone else can help out?
>
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 21 Aug 2000 12:05:26 GMT
From: rdpopesoftware@aol.com (Roy Pope)
Subject: POP3 script in cgi
Message-Id: <20000821080526.20828.00000420@ng-ct1.aol.com>

Hi all,

I am looking for a script that -

(a) allows users to check their POP3 mailboxes via a web page by entering their
email address, mail server, and password (similar to QD-POP), and
(b) allows those same users to send email via the web page using the sendmail
on my server

Why sendmail? 

(a) Because I dont have an SMTP server that I can configure into the script,
and
(b) Many people don't know the difference between a POP server and an SMTP
server, which could cause problems for them if I had a field for them to
specify their SMTP server when sending mail

If anyone knows of such a script, I would surely appreciate a response.

Regards,
Roy Pope
Webmaster@rd-soft.com
+++++++++++++++++
Webmaster "Voice-Chat" conference room now open at -     
http://www.rd-soft.com/talklive/index.html



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

Date: Mon, 21 Aug 2000 13:42:38 +0200
From: "chris müller" <jemand@klop.com>
Subject: Re: problems with Tk and NT4
Message-Id: <8nr4ho$bc5$1@pollux.ip-plus.net>

no way , it does not work.
chris





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

Date: Mon, 21 Aug 2000 12:21:32 GMT
From: kingofkingston@my-deja.com
Subject: Re: read files from dir then write as csv???
Message-Id: <8nr6s0$5hu$1@nnrp1.deja.com>

Cheers, it worked a treat.


In article <399D8064.5C337885@vpservices.com>,
  Jeff Zucker <jeff@vpservices.com> wrote:
> kingofkingston@my-deja.com wrote:
> >
> > In article <399C27B9.9A7EF4AC@vpservices.com>,
> >   Jeff Zucker <jeff@vpservices.com> wrote:
> > >
> > > There are many ways to do this.  Here is one way using DBI (which
you
> > > are probably already using for Oracle) and DBD::RAM.
>
> > Unfortunately I dont think
> > I'll be able to implement it as the unix box the Ora DB is on is a
> > client's box (internal department) and they are being very cranky
about
> > having to install things on it.
>
> If they are already using DBI for Oracle, then it is a fairly simple
> thing to install DBDs in your own directories.
>
> > It look like I'll have to resort to using arrays and hashes to
> > manipulate the data in the files, and find some way of outputing a
CSV
> > file.
>
> You can use the part of the code I sent that captures the date,
> table_name, and row_count and then just write that to CSV using any of
> the modules or non-moudle methods listed in perlfaq4, or since in this
> particular case in which there are no embedded anythings, just use
join.
>
> --
> Jeff
>


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 21 Aug 2000 12:17:55 GMT
From: a94eribe@my-deja.com
Subject: reg exp help
Message-Id: <8nr6l8$5f8$1@nnrp1.deja.com>

Hi

I´m new to regular expressions and I would like some help.

I need to check that the user submitted a correct swedish postal code.
The rules is the following:

1. It should either be 5 or 6 characters
2. If it is 6 characters, character no 4 should be a white space.
3. It should only contain digits.

How would the notation for that be?

Thanks for your help

/Erik


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: Mon, 21 Aug 2000 14:42:50 +0200
From: Abe Timmerman <abe@ztreet.demon.nl>
Subject: Re: rookie question: comparing text string to directory contents
Message-Id: <dd72qsg5hom03udrmlissj0kj60993rsre@4ax.com>

[alt.perl removed]
On Sun, 20 Aug 2000 15:24:55 -0700, David <NIXSPAMdrh@engineer.com>
wrote:

> Hi
> 
> I've begun learning perl to better administer my system.  I'd appreciate any help on this next
> question:
> 

[ snip of filename specs]

> In a text file, each on a separate line, there is a list of the file names
> (before the underscore) in "directory A" in the following format:
> 
> 1234...xxx
> where 1234...xxx is a string of numbers between 5 and 12 characters in length
> 
> Most of the numbers in the text file have a corresponding match in directory A 
>(minus the underscore, the random digits and the .psd extension)
> 
> I have been trying to write a script that will compare the text file to the 
> contents of directory A that will leave all matches alone, copy "orphan"  strings
> in the text file to text file B and move  orphans of directory A into directory B.

I suppose you mean prefixes in file A, that don't have corresponding
files in directory A, should be written to file B and files in directory
A that don't have a corresponing prefix in file A should be moved to
directory B?

#!/usr/bin/perl -w
use strict;

use File::Copy;

my $dir_a  = './testfiles/A';
my $dir_b  = './testfiles/B';
my $file_a = 'index.A';
my $file_b = 'index.B';

#get the contents of $file_a from $dir_a;
open IFILE, "$dir_a/$file_a" or
	die "Can't open[r] '$dir_a/$file_a': $!";
my %index = map {chomp; ($_ => 1) } <IFILE>;
close IFILE;

#read directory and get 'orphans' from it.
#keep track of all prefixes in %seen
my %seen;
opendir SDIR, $dir_a or die "Can't opendir '$dir_a': $!";
my @orphans = 
	grep {
		/^(\d{5,12})_\w+\.psd$/;
		$1 && -f "$dir_a/$_" &&
		++$seen{$1} && !exists $index{$1}
	} readdir SDIR;
closedir SDIR;

#@orphans are files not in $file_a, but in the directory
move("$dir_a/$_", "$dir_b/$_") for @orphans;

#write all childless prefixes from $file_a to $file_b
open IFILE, ">>$dir_a/$file_b" or 
	die "Can't open[a] '$dir_a/$file_b': $!";
print IFILE "$_\n" for grep { !exists $seen{$_} } keys %index;
close IFILE;

__END__

-- 
Good luck,
Abe


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

Date: Mon, 21 Aug 2000 14:31:25 +0200
From: "Guenther Degenfelder" <guenther.degenfelder@datev.de>
Subject: Re: Running Perl-Script as NT-Service
Message-Id: <39a121aa$1@news.datev.de>


"Guenther Degenfelder" <guenther.degenfelder@datev.de> schrieb im
Newsbeitrag news:399d2fa1$1@news.datev.de...
>
> "Guenther Degenfelder" <guenther.degenfelder@datev.de> schrieb im
> Newsbeitrag news:399c0912$1@news.datev.de...
> > Yes. Very ugly. I know...
> ...
>
> Thank you for the very helpful hints!!!
 ...
> The Win32::Deamon module sounds very good, but yet i haven't tested it.
> I'm sure it will run too!

I've got it!
    C:\>set HTTP_proxy=http://www...

    C:\>ppm

    PPM interactive shell (1.1.4) - type 'help' for available commands.

    PPM> set repository RothConsulting http://www.roth.net/perl/packages

    PPM> install Win32::Daemon

    ....

With the included examples i made a litte demo.
And it runs!!!
ONE script including installation and removing of the service!!!

Lots of thanks for your help!!!

    Guenther




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

Date: Mon, 21 Aug 2000 10:54:44 GMT
From: akdwivedi@hotmail.com
Subject: Usning Errno
Message-Id: <8nr1pe$76$1@nnrp1.deja.com>

Hi,

I am using the following code to open some files..

$fh = INFILE1;
if(!open($fh,$filename) )
{
    die "Failed to open file, Error: $!\n";
}
This code seems to working fine in normal conditions.. One of my
programs wriets some files in a source directory every 90 secs and this
script reads these files.. after processing some 400 files, the open
fails, but I don't get any error Message ($! is an empty string)..
Is there a way to catch the error number instead of error string.. I
can't use POSIX::errno() fro some reasons..

Thanks in advance..
Anoop


Sent via Deja.com http://www.deja.com/
Before you buy.


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

Date: 21 Aug 2000 13:26:52 +0100
From: nobull@mail.com
Subject: Re: Usning Errno
Message-Id: <u97l9adckz.fsf@wcl-l.bham.ac.uk>

akdwivedi@hotmail.com writes:

> fails, but I don't get any error Message ($! is an empty string)..
> Is there a way to catch the error number instead of error string..

See the description of $! in perldoc perlvar

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


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

Date: Mon, 21 Aug 2000 07:38:48 -0500
From: "Paul R. Andersen" <panderse@us.ibm.com>
Subject: Re: We Need Your Feedback
Message-Id: <39A122D8.E1998E34@us.ibm.com>

waseema@my-deja.com wrote:
> 
> Hi
> 
> We are currently at the very end of the developemnt of a brand new IT
> site , covering every issue to do with the this vast medium of
> communication and business.
> 
> We would like your feedback on what we should include on the site.
> 
> Please visit http://www.itstop.com
> 
> pre-register and youi will be sent an intorductory Pack via e-mail
> 
> alternatively e-mail us at
> 
> info@itstop.com
> 
> Thank you for your time
> 
When the first page of something that claims to be big time has multiple
instances of bad grammar (poor sentence construction, missing commas,
and so on), I figure the rest of the pages are not going to be worth
exploring.  Hire an English major to review and correct your pages. 
-- 
Paul Andersen
+++++++++++++
The difference between theory and practice is that in theory there is no
difference between theory and practice; but in practice there is.


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

Date: Mon, 21 Aug 2000 12:54:25 GMT
From: jan.heidbrink@gmx.net (Jan Heidbrink)
Subject: would you recommend buying a book
Message-Id: <8nr8k3$91sjd$1@ID-32383.news.cis.dfn.de>

Hi!
I'm planning to learn pearl. I'll mainly use it for CGI.
Would you recommend to buy a book (if yes, where can I find an
overview about some) or do you think, a free tutorial is enough? I'd
prefer the last one as I don't have very much money. However, if you
think that I should buy a good book, I'd do that.

BTW: I'm already familiar with Pascal and C++.


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

Date: 16 Sep 99 21:33:47 GMT (Last modified)
From: Perl-Users-Request@ruby.oce.orst.edu (Perl-Users-Digest Admin) 
Subject: Digest Administrivia (Last modified: 16 Sep 99)
Message-Id: <null>


Administrivia:

The Perl-Users Digest is a retransmission of the USENET newsgroup
comp.lang.perl.misc.  For subscription or unsubscription requests, send
the single line:

	subscribe perl-users
or:
	unsubscribe perl-users

to almanac@ruby.oce.orst.edu.  

| NOTE: The mail to news gateway, and thus the ability to submit articles
| through this service to the newsgroup, has been removed. I do not have
| time to individually vet each article to make sure that someone isn't
| abusing the service, and I no longer have any desire to waste my time
| dealing with the campus admins when some fool complains to them about an
| article that has come through the gateway instead of complaining
| to the source.

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 V9 Issue 4079
**************************************


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