CGI meets Archive::Zip

2007-12-09 Thread Tim Bowden
I'm trying to write a small cgi app that takes an uploaded zip file, extracts the contents and does some operations on the included files. Following is a cut down version of my attempts to understand how to manipulate a zip file. It doesn't work (surprise, surprise!) It creates an empty file with

Re: Compressing a statement if X for Y to one line

2007-12-09 Thread John W . Krahn
On Sunday 09 December 2007 17:05, Jeff Pang wrote: > > On Dec 10, 2007 6:23 AM, yitzle <[EMAIL PROTECTED]> wrote: > > > > Can the following code be done without any "code blocks"? ^ > > do {print "$_\n" if($_ > 3);} for (0..5); > > > > Thi

Re: Compressing a statement if X for Y to one line

2007-12-09 Thread yitzle
Thanks for the replies! On 12/9/07, John W. Krahn <[EMAIL PROTECTED]> wrote: > $_ > 3 and print "$_\n" for 0 .. 5; This one instantly appealed to me for some reason. I love it! Reminds me of the Python version of the if operator (? :). (I started reading Dive Into Python this last week. Strong ty

Re: web page access tip

2007-12-09 Thread yitzle
The FireDebug extension for FireFox is also useful for examining web page sources On 12/9/07, Eric Krause <[EMAIL PROTECTED]> wrote: > All, > I have seen a lot of questions on this forum for automating web page > accessing, some of which I've posted myself. I just wanted to share > something I fou

Re: Compressing a statement if X for Y to one line

2007-12-09 Thread Jeff Pang
On Dec 10, 2007 6:23 AM, yitzle <[EMAIL PROTECTED]> wrote: > Can the following code be done without any "code blocks"? > do {print "$_\n" if($_ > 3);} for (0..5); > > This doesn't work: > print "$_\n" if($_ > 3) for (0..5); > $ perl -le 'print join" ",grep {$_>3} 0 ..5' 4 5 -- To unsubscribe, e-

Re: How to open a file and perform an action on it.

2007-12-09 Thread reader
"Mark" <[EMAIL PROTECTED]> writes: > Yes, this seems like what I want to do. I would like to open the file using > the external software program, run one command on it using the external > software, and then save it. If that one command is not setable from a command line it will become serious

Re: Compressing a statement if X for Y to one line

2007-12-09 Thread John W . Krahn
On Sunday 09 December 2007 14:23, yitzle wrote: > > Can the following code be done without any "code blocks"? > do {print "$_\n" if($_ > 3);} for (0..5); $_ > 3 and print "$_\n" for 0 .. 5; print map $_ > 3 ? "$_\n" : (), 0 .. 5; John -- use Perl; program fulfillment -- To unsubscribe, e-

web page access tip

2007-12-09 Thread Eric Krause
All, I have seen a lot of questions on this forum for automating web page accessing, some of which I've posted myself. I just wanted to share something I found. I was using WWW::Mechanize and it worked absolutely great, but I had problems figuring out what objects were called. I viewed the pa

Compressing a statement if X for Y to one line

2007-12-09 Thread yitzle
Can the following code be done without any "code blocks"? do {print "$_\n" if($_ > 3);} for (0..5); This doesn't work: print "$_\n" if($_ > 3) for (0..5); In Python, you'd do something similar to: print "$_\n" for (0..5) if($_ > 3); but that doesn't work either. If there a way to loop through a

Re: How to open a file and perform an action on it.

2007-12-09 Thread Mark
Yes, this seems like what I want to do. I would like to open the file using the external software program, run one command on it using the external software, and then save it. The software like I said before is not widely known. What happens is the drill program is made through a main CAD sof

Re: get full month name

2007-12-09 Thread Gunnar Hjalmarsson
Jo for Groups and Lists wrote: Can you use Date::Manip ? $fullMonth = &returnFullmonth($month); sub returnFullmonth { use Date::Manip; return UnixDate("2007/$_/01",'%B'); } This will handle feb, 02, or 2 No, it won't handle anything. C:\home>type test.pl use warnings; $TZ

Re: How to open a file and perform an action on it.

2007-12-09 Thread reader
"Mark" <[EMAIL PROTECTED]> writes: > I have looked at the perlopen tuturial, but I am still not sure how to > accomplish this. I just can't believe that it is as easy as, > open(INFO, "datafile") || die("can't open datafile: $!"); In other > words how does it know what software to open t

Re: DB Conversion script issues

2007-12-09 Thread Tom Phoenix
On 12/8/07, David Gilden <[EMAIL PROTECTED]> wrote: > Could some please tell me why this writing the data like think it should. I'm not sure what you're asking. Is there a verb in your sentence? Is it missing some other key words? I think your perl binary is doing what you asked of it. > Input d

Re: How to open a file and perform an action on it.

2007-12-09 Thread Chas. Owens
On Dec 8, 2007 9:57 PM, Mark <[EMAIL PROTECTED]> wrote: > I have a simple question regarding file manipulation. I am trying to open a > file using a program (e.g. word, excel, etc.) and then perform an action on > it using the program and save it as a new file name. If someone could point > in th

Re: How can I print a number larger than 128?

2007-12-09 Thread Chas. Owens
On Dec 9, 2007 10:57 AM, Chas. Owens <[EMAIL PROTECTED]> wrote: snip > my $maxlen = 2**32-1; > croak "$msg is too long (there is a $maxlen byte limit)" if $len > > $maxlen; > print $sock pack "Ca*", $len, $msg; snip Whoops, I had a copy and paste error there. That should be my $

Re: How can I print a number larger than 128?

2007-12-09 Thread Chas. Owens
On Dec 9, 2007 7:10 AM, Niu Kun <[EMAIL PROTECTED]> wrote: snip > My network protocol is like this: > String length(4 bytes, big endian) plus the real string. > For simple simulate purpose, I'll limit the string length to less than 256. > So I've got one byte containing the length of the string. >

Re: How to open a file and perform an action on it.

2007-12-09 Thread yitzle
If you just want to open a file and save it under a different name, you can just copy the file. If you want to do something that has to be done via a specific program, you might want to consider a macro program like AutoHotKey (http://www.autohotkey.com/) -- To unsubscribe, e-mail: [EMAIL PROTECT

RE: get full month name

2007-12-09 Thread Jo for Groups and Lists
Can you use Date::Manip ? $fullMonth = &returnFullmonth($month); sub returnFullmonth { use Date::Manip; return UnixDate("2007/$_/01",'%B'); } This will handle feb, 02, or 2 but will not handle february itself - so you may want to check first that you are indeed passing in 1-2

Re: How can I print a number larger than 128?

2007-12-09 Thread Niu Kun
Chas. Owens : > On Dec 8, 2007 8:32 AM, Niu Kun <[EMAIL PROTECTED]> wrote: >> Dear all, >> I'm new here. >> I've got a number larger than 128. >> I want to send it by socket. >> I find that if print the number directly, I'll print the number in ascii >> format. >> So I'll have 3 separate numbers tr

Re: How can I print a number larger than 128?

2007-12-09 Thread Niu Kun
Tom Phoenix wrote: > On 12/8/07, Niu Kun <[EMAIL PROTECTED]> wrote: > >> I've got a number larger than 128. >> I want to send it by socket. >> I find that if print the number directly, I'll print the number in ascii >> format. >> So I'll have 3 separate numbers transmitted. >> But I only want to t

Re: Crypt SQLite

2007-12-09 Thread Octavian Rasnita
From: "Chas. Owens" <[EMAIL PROTECTED]> On Dec 6, 2007 1:47 PM, Octavian Rasnita <[EMAIL PROTECTED]> wrote: Hi, I've seen a program made in C# that uses an SQLite database which is crypted. Can we do the same thing with perl? Some years ago I've seen only some comercial solution for doing thi

Re: Crypt SQLite

2007-12-09 Thread Octavian Rasnita
From: "David Filmer" <[EMAIL PROTECTED]> On Dec 6, 10:47 am, [EMAIL PROTECTED] (Octavian Rasnita) wrote: I've seen a program made in C# that uses an SQLite database which is crypted. I doubt that. SQLite does not (AFAIK) have an encrypted database engine. The only way that such a program co

Re: How can I print a number larger than 128?

2007-12-09 Thread Niu Kun
Gunnar Hjalmarsson : > Niu Kun wrote: >> I've got a number larger than 128. >> ... > > Do not multi-post!! > http://groups.google.com/group/comp.lang.perl.misc/browse_frm/thread/0fa92f6197696b8e > > I'm sorry for the troublsome I caused. -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additi

DB Conversion script issues

2007-12-09 Thread David Gilden
Greetings, Could some please tell me why this writing the data like think it should. Input data: 4,'Daniel Niederer','','Wberweg 3A','','Hersiwil',' Sample of the output: (first 4 'columns' ) 4,'Daniel Niederer','','Wberweg 3A','','Hersiwil','4558', I would think it should print to disk the f

How to open a file and perform an action on it.

2007-12-09 Thread Mark
I have a simple question regarding file manipulation. I am trying to open a file using a program (e.g. word, excel, etc.) and then perform an action on it using the program and save it as a new file name. If someone could point in the direction of an example of something like this. FYI, the p