Christopher J Bottaro wrote:
hey,
i wanna make a perl script that will convert those stupid "\r\n" dos newlines
to good unix "\n" newlines...=) the problem isn't really a perl problem, but
a general programming problem that i've always kinda wondered about.
so i guess what i'm gunna do is op
hello,
i want to make a sub that is to be used like this:
my @array;
open(INFILE, "blah");
ParseOneItem (INFILE, \@array);
i know how to pass the array reference, but how do i pass the file handle?
can i do it just like that?
thanks,
christopher
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
Fo
hello people,
When I'm trying to server which listens on tcp port and
forking child process i'm getting lot of defunct process when the server
gets lots of requests . Can any body explains why this happens in
general ?
TIA
Regards
A.Johnson
--
To unsubscribe, e-mail: [EMAIL PR
Jose Malacara wrote:
>
> Hello. I have a python script that I would like to convert to perl. In it
> I am parsing a data file looking for occurences of three consecutive lines:
>
> series1 = """
> slot-1 UPUP t3-card
> slot-2 UPUP madd2-card
> slot-3
Jerry Rocteur wrote:
>
> Hi,
Hello,
> I like this list very much and I think it is very helpful!
>
> In my work and at home I spend most of my time at a UNIX prompt, either
> Linux, Mac OS X, Solaris etc.
>
> I know the Korn shell very well and I can get by with Perl but I find
> myself always
Danny Grzenda wrote:
>
> DB4515C,625.25,378,327,382,352,805,163,513.5,699,257.88,,,"4,503","1,801",80 5
>
> Trying to create a regex to substitute comas with pipes, except for the
> commas between the double quotes.
>
> can't get one to work.
You have to parse the data. Here is some code modif
Hi Jerry,
I subscribe to a few "Nothing but UNIX" groups. The site below should
accommodate all of your needs.
http://unix.ittoolbox.com/
Best regards,
> Paul Ohashi
> Technical Specialist
> Quest Software, Inc.
> (949) 754-8000
> www.quest.com/support
>
-Original Message-
From: Je
Marcelo wrote:
>
> Hi everybody ...
Hello,
> When I receive mail.. I can see it like a plain text file under
> /var/spool/mail/marcelo where all the messages are concateneted one
> after the other here is an example :
>
> From [EMAIL PROTECTED] Fri Dec 6 17:56:19 2002
>
> [snip]
>
> A
Honestly buy learning Perl and programming Perl. Read them in this
order. Learning PERL is an awesome starting point. Will teach you all
the simple day to day things. Both books by Oreile.
> -Original Message-
> From: Jerry Rocteur [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2
Hello. I have a python script that I would like to convert to perl. In it I am parsing
a data file looking for occurences of three consecutive lines:
series1 = """
slot-1 UPUP t3-card
slot-2 UPUP madd2-card
slot-3 UPUP madd2-card"""
or
The last time I attempted this, I got soo fraastrated. If you can get
perlexe to work, that is the way to go.
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://www.tux.org/mailman/listinfo/ma-linux
__
William Ampeh (x3939)
Federal Reserve Board
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I suggest you take a look @ http://lists.perl.org. They have all official
mailing lists up there. And there are archives, too:
http://archive.develooper.com (or archives, check it out yourself). Ooh, got
some itch there ;-)
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-host
Hi,
I like this list very much and I think it is very helpful!
In my work and at home I spend most of my time at a UNIX prompt, either
Linux, Mac OS X, Solaris etc.
I know the Korn shell very well and I can get by with Perl but I find
myself always doing stuff in ksh instead of Perl. I've rece
you can also look inside /proc although the data in there is mostly binary.
PS just parses your proc directory. read up on PROCFS
Mark
- Original Message -
From: <[EMAIL PROTECTED]>
To: "zentara" <[EMAIL PROTECTED]>
Cc: <[EMAIL PROTECTED]>
Sent: Friday, December 13, 2002 1:48 PM
Subject:
>
> I'm new with PERL - I have a very simple PERL program that will accept
> data from an HTML program and send it out as an email. In the HTML
> program, the data items are filled in and then the PERL/CGI program is
> called by a POST. The PERL/CGI program runs, the screen goes blank and
> the em
From: Adriano Rodrigues Ferreira <[EMAIL PROTECTED]>
> >DB4515C,625.25,378,327,382,352,805,163,513.5,699,257.88,,,"4,503","1,
> >801",805
> >
> >Trying to create a regex to substitute comas with pipes, except for
> >the commas between the double quotes.
>
> I think there is no regex which makes su
I'm new with PERL - I have a very simple PERL program that will accept
data from an HTML program and send it out as an email. In the HTML
program, the data items are filled in and then the PERL/CGI program is
called by a POST. The PERL/CGI program runs, the screen goes blank and
the email is sent.
>
>DB4515C,625.25,378,327,382,352,805,163,513.5,699,257.88,,,"4,503","1,801",805
>
>Trying to create a regex to substitute comas with pipes, except for the
>commas between the double quotes.
I think there is no regex which makes such a miracle. Maybe this has to do with the
fact that regex are re
$var =~ s/^\,$/|/;
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
From: Danny Grzenda <[EMAIL PROTECTED]>
To: "'[EMAIL PROTECTED]'" <[EMAIL PROTECTED]>
Subject: regex help
Date: Thu, 12 Dec 2002 12:52:59 -0600
DB4515C,625.25,378,327,382,
Thanks all for the suggestions.
Looks like I'm stuck using the ps command. I'm writing this script on an
appliance system with very limited perl modules loaded (can't load more
because it needs to work on the appliance as it is shipped).
I appreciate the feedback.
-gomes
On Thu, 12 Dec 2002
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi listers,
i am a perl beginner with an interesting problem (to me atleast :).
Problem Overview
-
Somewhere on the world wide web, exists an asp page with the following
form -
On entering a valid roll number and pressing enter, re
On Fri, 13 Dec 2002, christopher j bottaro wrote:
> hey,
> i wanna make a perl script that will convert those stupid "\r\n" dos newlines
> to good unix "\n" newlines...=) the problem isn't really a perl problem, but
> a general programming problem that i've always kinda wondered about.
>
> so
Apparently build 603 of ActiveState's version had exactly what you are
asking for in HTMLHELP (.chm) format. It doesn't seem to be included
anymore:
http://aspn.activestate.com/ASPN/Perl/Products/ActivePerl/Changes.html
If you want to try Beau's last suggestion, it may be easier than it sounds:
ht
Thank you, Bob.
I have now downloaded the examples from CPAN (from the web browser,
actually, not the CPAN shell).
I was about to say ActiveState has ppm instead of CPAN, but you made me
double check and it actually has both. Ran the helpful CPAN shell wizard, I
am missing some of the executables
DB4515C,625.25,378,327,382,352,805,163,513.5,699,257.88,,,"4,503","1,801",80
5
Trying to create a regex to substitute comas with pipes, except for the
commas between the double quotes.
can't get one to work.
thanks
Custom Technology Solutions
http://www.ctssys.com
Daniel G. Grz
This breaks down for many messages that have 2 "From"'s. Most messages start with a
From not followed by a colon that is the envelope leader and include a From: (notice
followed by a colon) that is in the message headers.
I would suggest you not reinvent the wheel and check out the many modules
Sorry about the multiple messages on this.
I was able to resolve my problem with Net::SSH::Perl die()ing if a
connection fails by using the following:
eval {
$sftp = Net::SFTP->new($host, user=>$host, password=>$pass);
};
then I check if $sftp is defined to decide whether or not to send
On Friday 13 Dec 2002 10:42 am, christopher j bottaro wrote:
> hey,
> i wanna make a perl script that will convert those stupid "\r\n" dos
> newlines to good unix "\n" newlines...=) the problem isn't really a perl
> problem, but a general programming problem that i've always kinda wondered
> about
for ($i=0; $i<1024; $i++) {
if ($var =~ /^\\r\\n$/) {
$var =~ s/^\\r(\\n)$/$1/;
}
# First time using $1! Hope it works =)
}
Well, and the for loop ensures the file isn't bigger as 1024, 1mb.
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTE
Here is a start. I put to an array, but you could write to a file:
#!perl -w
my @MyMail = ();# hold email
my $MyHoldMail = '';# use to build each email msg
my $In = 0; # count of lines
my $MyProc = 0; # ready to process or not
while ( ) {
I am playing with a daemon that forks and am trying to be thorough as this will
hopefully become production code. My daemon uses:
use POSIX qw(:sys_wait_h :errno_h :signal_h);
For some of the fork handling. Later I looked at the fork description from The Camel
(3rd Edition - pg. 715) and then
Hi everybody ...
When I receive mail.. I can see it like a plain text file under
/var/spool/mail/marcelo where all the messages are concateneted one
after the other here is an example :
From [EMAIL PROTECTED] Fri Dec 6 17:56:19 2002
Return-Path: <[EMAIL PROTECTED]>
Received: from insight
Ok, so I found that my problem appears to come from the following
portion of Net::SSH ::Perl:
connect($sock, sockaddr_in($rport, $raddr))
or die "Can't connect to $ssh->{host}, port $rport: $!";
Why should it die() and not just warn()?
I found something that suggests I can intercept di
Should use warnings for you have @exculde; which is not what you
loaded data with.
Wags ;)
-Original Message-
From: Paul Kraus [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 13, 2002 08:07
To: 'Bob Showalter'; 'Perl'
Subject: RE: Conditional Array lookup
I don't think I under
Unfortunately, using the || as below doesn't change the behavior. Once
my script tries to make the connection and can't, it exists with a
"connection failed to $host, etc. etc." message, whether I use warnings
or diagnostics or neither. If anyone can help me understand why this
may be or if t
I don't think I understand this. per perldoc and your instruction this
should work.
my @exclude = qw /du huh . ../;
%exclude = map {$_=>1} @exculde;
print "$_\n" foreach (@exclude); # Prints array
print "$k $v\n" while (($k,$v) = each %exclude); #prints nothing.
Paul
> -Original Message--
perldoc -f pack [used in almost any standard header-parsing routine]
Joseph
"Johnstone, Colin" wrote:
> Toby, anyone,
>
> My next question is I guess I need to know now why this happens?
>
> So that I can anticipate it and code for it in the future.
>
> e.g sorcha.o'[EMAIL PROTECTED]
>
> So why
> -Original Message-
> From: Paul Kraus [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 10:19 AM
> To: 'Perl'
> Subject: Conditional Array lookup
>
>
> Is there a way to do an if or unless against an entire array.
>
> @exclude =
>
> #compare $soomevaraible to every ele
Paul
unless grep ($somevariable == $_, @exclude)
Rob
- Original Message -
From: "Paul Kraus" <[EMAIL PROTECTED]>
To: "'Perl'" <[EMAIL PROTECTED]>
Sent: Friday, December 13, 2002 3:18 PM
Subject: Conditional Array lookup
> Is there a way to do an if or unless against an entire arra
I'd be using:
#!/usr/bin/perl -w
$dir = "/backup";
opendir BACKUPDIR, $dir or die "Cannot open $dir!";
foreach (readdir BACKUPDIR){
unless ($_ eq "." or $_ eq ".."){
#print "$_";
push (@dirs,$_);
}
foreach (@dirs) {
print "$_\n";
}
}
--
Bob Erinkveld (Webmaster Insa
perldoc -f map
perldoc -f grep
http://danconia.org
On Fri, 13 Dec 2002 10:18:30 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote:
> Is there a way to do an if or unless against an entire array.
>
> @exclude =
>
> #compare $soomevaraible to ev
doht! Thanks!
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 10:13 AM
> To: Paul Kraus; Perl
> Subject: RE: Readdir to array
>
>
> You are foreah'ing in your foreach. So it is printing the
> contents of the array foreach of t
Is there a way to do an if or unless against an entire array.
@exclude =
#compare $soomevaraible to every element of @exclude.
unless ($somevariable eq @exclude){
...
}
Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com
--
To
I know little about Unix, but this will hopefully works.
Maybe if you are interested about some subtle ways to hide your code even in a system
which just can't close the doors
for unwanted visitors (like Windows Me), you can find useful to take a look at:
perldoc -m perlfilter
Good lu
You are foreah'ing in your foreach. So it is printing the contents of the array
foreach of the files in the directory...
http://danconia.org
On Fri, 13 Dec 2002 09:56:19 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote:
> for some reason the outpu
Stuff the variable names into an array, use a regex to delete all the
slashes (as you will declare the names with a slash in front of it).
Or anything like that. Actually, I think the syntax is ok. I'm sure local()
can do this, so why can't my? Just try to accomplish something else with
this con
exec() exits the calling program and does not return.
system() returns the called program's exit status then allows the
calling program to resume execution.
"Programming Perl", 3rd Edition, p.811
On Fri, 2002-12-13 at 08:01, Paul Kraus wrote:
> if I exec a Perl script from a Perl script that fir
> -Original Message-
> From: Dennis HO Siu-chung [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 4:01 AM
> To: [EMAIL PROTECTED]
> Subject: Execute perl program without seeing the code?
>
>
> Can I let someone execute my perl code without seeing the
> code on UNIX system?
>
for some reason the output is different for this script. If I print $_ I
get the correct list. If I print the Array I get roughly the same list 4
times?
#!/usr/bin/perl -w
$dir = "/backup";
opendir BACKUPDIR, $dir or die "Cannot open $dir!";
foreach (readdir BACKUPDIR){
unless ($_ eq "." or $_
Paul Kraus wrote:
> I want the parent process to end. I am just trying to decide if I can
> start a second script without having to tie them together in a batch
> file.
exec overlays the memory image of the calling process, i.e. the calling
process is gone
after the call to exec. I wouldn't exact
It's easy. Use SSI (Server Side Includes)
As Ken said:
But maybe you may change the .html extension to .shtml
-rm-
- Original Message -
From: Ken Lehman <[EMAIL PROTECTED]>
To: 'Adam Wilson' <[EMAIL PROTECTED]>; <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 2:41 PM
Subject: RE
I want the parent process to end. I am just trying to decide if I can
start a second script without having to tie them together in a batch
file.
> -Original Message-
> From: Kipp, James [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 9:15 AM
> To: 'Paul Kraus'; 'Perl'
> Subje
I rarely use 'exec' but i believe the parent script just exits . here is
some more from the docs:
Since it's a common mistake to use "exec" instead of "system",
Perl warns you if there is a following statement which isn't
"die", "warn", or "exit" (if "-w" is set - but you always do
that). If you
Crap I read that wrong. I was thinking like you noticed of not having to
escape the "forward" slash. My bad :)
> -Original Message-
> From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002 8:56 AM
> To: [EMAIL PROTECTED]
> Subject: RE: Regex question
>
>
>
I understand this. However may concern is what is the parent app doing
while the exec program runs. I know it returns nothing and dumps to
shell when its finished but when is the first program released? Maybe I
am not understanding you it is rather early :-)
> -Original Message-
> From: Ki
Paul Kraus wrote:
>
> > From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> >
> > Yes that will work although you don't need to backslash the
> > quote in the regular expression.
> >
> > $ perl -le'$_ = q[one "two" three]; s{"}{\\"}g; print'
> > one \"two\" three
>
> Correct me if I am wrong but the
perldoc -f exec
exec LIST
exec PROGRAM LIST
The "exec" function executes a system command *and never
returns*-- use "system" instead of "exec" if you want it to
return. It fails and returns false only if the command does not
exist *and* it is executed directly inste
if I exec a Perl script from a Perl script that first program will end
and then start the second or will it continue to run until both programs
have finished?
Paul Kraus
Network Administrator
PEL Supply Company
216.267.5775 Voice
216-267-6176 Fax
www.pelsupply.com
--
To unsubscribe, e-mail: [EM
On Fri, 13 Dec 2002 08:30:24 -0500, "Paul Kraus" <[EMAIL PROTECTED]> wrote:
> Correct me if I am wrong but the only time you need to escape a
> backslash is if your regexpr is started and terminated with it. Since
> you are using {} I don't think y
Correct me if I am wrong but the only time you need to escape a
backslash is if your regexpr is started and terminated with it. Since
you are using {} I don't think you need to do that.
> -Original Message-
> From: John W. Krahn [mailto:[EMAIL PROTECTED]]
> Sent: Friday, December 13, 2002
Colin Johnstone wrote:
>
> Gidday all,
Hello,
> I have a paragraph of text, I want to convert any double quotes around
> quoted text to \" is this the correct reg ex
>
> $paragraph =~ s{\"}{\\"}g;
Yes that will work although you don't need to backslash the quote in the
regular expression.
$ p
Mariusz wrote:
>
> In one of my scripts I have lots of variables to declare. I wanted to type them in
>groups instead of one long line but I think dividing my lines trough the use of the
>ENTER key stops the script from working. (Although when I check the syntax through
>"perl - c script.cgi" i
On Thu, 12 Dec 2002 17:43:34 +0100, [EMAIL PROTECTED]
(Olivier Moulene) wrote:
>I have the pid of one running process and i want to kill it and all its children.
>What can i do to know the pids of every children ?
This untested code from perlmonks.org, it might give you some ideas.
What you are a
Hi
I need to extract the text from a word document.
I know how to :
Print a word document using the default printer :
-
use strict;
use Win32::OLE;
u
Kris Gaethofs wrote:
> Hi,
>
> I could use some help with the following problem:
>
> I have this input file that looks like this (after some processing):
>
> %1%MO%1s%.%-.0003%.%.0003%.0002%.0006%-.0005%.0020%-.0035%.0006
> %2%MO%1s%-.0001%-.0021%-.0003%.0018%.0015%.0042%-.0034%.0136%-.023
hey,
i wanna make a perl script that will convert those stupid "\r\n" dos newlines
to good unix "\n" newlines...=) the problem isn't really a perl problem, but
a general programming problem that i've always kinda wondered about.
so i guess what i'm gunna do is open the file, read in a line, sea
Hi,
I could use some help with the following problem:
I have this input file that looks like this (after some processing):
%1%MO%1s%.%-.0003%.%.0003%.0002%.0006%-.0005%.0020%-.0035%.0006
%2%MO%1s%-.0001%-.0021%-.0003%.0018%.0015%.0042%-.0034%.0136%-.0234%.0042
%3%MO%1s%-.0005%-.0085%-.00
Can I let someone execute my perl code without seeing the code on UNIX system?
e.g. chmod 711 perlprog.pl
-Dennis
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
69 matches
Mail list logo