Hi,
Just need to know any good docs/web links for Coding Standards In PERL. Any pointers
are welcome.
Thanks,
-Rajnish
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Brian Volk wrote:
> Is there a way to covert a .csv file to .tab file?
I would do something like this.
while (<>) {
@fields = split(/,/, $_);
$line = join("\t", @fields);
print $line;
}
You could do all that on one line, but I prefer readability.
--
Bud Rogers <[
At 03:47 PM 3/26/02 -0500, Nikola Janceski wrote:
>2 questions actually.
>
>1. Is there a way to make the debugger display the next N lines of code at
>each prompt (instead of just one).
You would probably prefer to just hit 'w' or 'l' whenever you want to see
more than one line. But... you can
I think the tab is \t. So try s/,/\t/g ?
-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 5:21 PM
To: [EMAIL PROTECTED]
Subject: .csv file to .tab file?
Hi All,
Is there a way to covert a .csv file to .tab file? I checked out the
module
Hi All,
Is there a way to covert a .csv file to .tab file? I checked out the
module Text::CSV_XS but I didn't see too much that made sence to me... :-)
I also looked into substitution, something like
while<) {
if(s/ , / tab or maybe 0x09 (tab)/ ) { # not sure how tab should be
expressed?
From: Mr Hash <[EMAIL PROTECTED]>
> On 03/26, Jenda Krynicky said something like:
> > From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > > > affect the performance of:
> > > > key listings (things like grep /pattern/, keys %hash)
> > >
> > > Grep can be slow, especially with patterns
On 03/26, Jenda Krynicky said something like:
> From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > > affect the performance of:
> > > key listings (things like grep /pattern/, keys %hash)
> >
> > Grep can be slow, especially with patterns. Keys
> > could be slow, especially if the d
This is actually a straight-unix grep question. I want to look for
values greater than one in a particular result. What is the
recommended, etc. way to do this?
-Brian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Timothy,
Thank you very much for the quick reply! It works great :-)
Brian
Timothy Johnson wrote:
>Try this:
>
>open(INFILE,"myfile.txt");
>open(OUTFILE,"SSlines.txt");
>while(){
> unless($_ eq "\n"){ #blank lines probably have only a \n
> print OUTFILE $_;
> }
>}
>
>-Orig
From: "KEVIN ZEMBOWER" <[EMAIL PROTECTED]>
> I hope it's okay to ask a question here regarding MIME::Lite. This is
> a fairly well-used module, that even beginners might run up against.
> Additionally, I suspect my problem doesn't have to do so much with
> MIME::Lite, as it does
From: "Jonathan E. Paton" <[EMAIL PROTECTED]>
> > affect the performance of:
> > key listings (things like grep /pattern/, keys %hash)
>
> Grep can be slow, especially with patterns. Keys
> could be slow, especially if the dataset is large.
Maybe you could try to use
whil
> How do the following attribute of a hash key:
> size (something like an alphanumeric
> string about 70 chars wide)
Longer strings take longer to hash, but 70
characters isn't massive. Hashing a string
takes time proportional to the length of the string.
> similarity (groups of abo
Hi,
Period (.) is a metacharacter so will not work. Needs to be escaped.
Like so:
$/=~/\./;
It would have been set elsewhere before testing.
Having you looked up Splitting the String (Digest No. 752).
There you'll find the following from one of the contributors
$a = 'abcdef';
@arr = split (//,
I wrote some experimental code and it looks like you don't have to reap
the children (maybe this is just a C thing).
On Tue, 2002-03-26 at 15:56, Ahmed Moustafa wrote:
> Chas, thanks a lot for your example.
>
> if the while loop is inside a main infinite loop (as if it was a
> daemon), do I sti
I hope it's okay to ask a question here regarding MIME::Lite. This is a
fairly well-used module, that even beginners might run up against.
Additionally, I suspect my problem doesn't have to do so much with
MIME::Lite, as it does with more general topics.
I'm writing a CGI program to take input fr
Try this:
open(INFILE,"myfile.txt");
open(OUTFILE,"SSlines.txt");
while(){
unless($_ eq "\n"){ #blank lines probably have only a \n
print OUTFILE $_;
}
}
-Original Message-
From: Brian Volk [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, March 26, 2002 1:48 PM
To: [EMAIL PROTECTE
Hi All,
I'm new to perl, so this may seem really basic, so any hints or
directions to help files would be greatly appreciated. :-)
I written a script that fetches a file from my web server (LWP::Simple
and Net::FTP::Common both work) and loads it into mysql. (DBI) That
part works great!
Right now my program is stomping my CPU...
How do the following attribute of a hash key:
size (something like an alphanumeric string about 70 chars wide)
similarity (groups of about 30% of the keys are similar for the 1st
n-10 characters
affect the performance of:
key listings (things l
err.. wrong.. I found it.. I am a moron.
local $/ = ""; is wrong.
should be:
local $/;
Thanx though... Don't mean to post but it stumped me for about a half hour
(too long for me).
> -Original Message-
> From: David Gray [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 4:25 PM
> I have a file with some settings, and I want to change some
> of them. But when I write the file, I lose everything after a
> certain point.
>
> Can someone point out my moronic mistake?
> Everything after "ROOT =" is lost but it changes "ROOT =" to
> the correct value.
>
> # perl here
>
Right now my program is stomping my CPU...
How do the following attribute of a hash key:
size (something like an alphanumeric string about 70 chars wide)
similarity (groups of about 30% of the keys are similar for the 1st
n-10 characters
affect the performance of:
key listings (things l
I have a file with some settings, and I want to change some of them.
But when I write the file, I lose everything after a certain point.
Can someone point out my moronic mistake?
Everything after "ROOT =" is lost but it changes "ROOT =" to the correct
value.
# perl here
$out = "";
On Tue, Mar 26, 2002 at 02:20:50AM -, John Bennett wrote:
> Hi All
>
> I have been looking into perlcc for a little while as I would like to
> compile a program to make the source unreadable, and haven't had much
> luck as it was compiling files of about 20MB which makes it a little
> harder
Chas, thanks a lot for your example.
if the while loop is inside a main infinite loop (as if it was a
daemon), do I still need to have the waitpid function? and if yes, where
should be located?
Once again, thanks a lot!
Chas Owens wrote:
> On Tue, 2002-03-26 at 01:14, Ahmed Moustafa wrote:
>
2 questions actually.
1. Is there a way to make the debugger display the next N lines of code at
each prompt (instead of just one).
2. What is the best way to avoid the loops on one line? I use c but I was hoping for a simpler solution. (ie. foreach my $line (map
{ stuff } @array){ )
Thanx
Ni
I have this script that checks processes on aix box.
My question is within the subroutine. If the process
is not running the return code is 256. How do prevent
it from sending multiple alerts to a pager? What I
want it do is send 1 page at a time for multiple
events.
Piece of my script:
$tel
To my knowledge the only limit is what your OS can handle.
On Tue, 2002-03-26 at 14:53, perl wrote:
> Is there a limit to the number of children in Perl?
>
>
> "Ahmed Moustafa" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > Tagore Smith wrote:
> >
> > >
Is there a limit to the number of children in Perl?
"Ahmed Moustafa" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Tagore Smith wrote:
>
> > Ahmed Moustafa wrote:
> >
> >
> >>So, how can a new different process by forked? Or, how a function be
> >>called and
I know that under Solaris 2.6 that a process couldn't hold more than 256
file descriptors, but that restriction was lifted in Solaris 7 and Solaris
8.
Using ulimit -n 1024 and the pfiles command, I can see that the process
running this particular Perl script in question has a 1024 limit but the
2
On Tue, 26 Mar 2002, Jorge Goncalvez wrote:
> Hi, I wonder if Perl under windows know short path like dos with tildes on it.
> Thanks.
Well, I'm not on a Windows PC, so I can't check, but I would think it
should - AFAIK, all filenames in Windows (at least on the FAT fs -
might be differnet on NTF
From: Jorge Goncalvez <[EMAIL PROTECTED]>
> Hi, I wonder if Perl under windows know short path like dos with
> tildes on it. Thanks.
use Win32;
print Win32::GetShortPathName( 'c:\program files'), "\n";
print Win32::GetLongPathName( 'c:\PROGRA~1'), "\n";
Jenda
==
Hi, I wonder if Perl under windows know short path like dos with tildes on it.
Thanks.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
At 01:58 PM 3/26/02 -0300, Mauricio Amorim da Silva wrote:
> Hi,
>
> My name is Mauricio.
> I'm from Brazil.
>
> I send this email for you, because i search to an question in the
> net, but didn't find.
>
> I'd like know if is possible debug an program in perl that uses
> Curses
Your answer is probably what he needs... (I am thinking too hard).
> -Original Message-
> From: Wagner-David [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, March 26, 2002 12:23 PM
> To: 'Brian Warn'; [EMAIL PROTECTED]
> Subject: RE: question
>
>
> If you enter only return and no inp
Yeah...what I do is while gathering the input. Look for 3 consecutive
newlines.
my $break;
while(){
last if $break == 3;
$break++, next if /^\n$/;
## do stuff to $_ here
}
> -Original Message-
> From: Brian Warn [mailto:[EMAIL PROTECTED]]
> Sen
If you enter only return and no input, then you could check on this:
chomp(my $MyInput = );
last if ( $MyInput eq '' );
Obviously this won't work if blank lines are allowed, but if not then could
try this way.
Wags ;)
-Original Message-
From: Brian Warn
Is there a way to have a script accept enter/return vs. ctrl+d to tell a
program where I specify that input be obtained via that I'm done
inputting data?
-Brian
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
Hi,
My name is Mauricio.
I'm from Brazil.
I send this email for you, because i search to an question in the net, but didn't
find.
I'd like know if is possible debug an program in perl that uses Curses, with perl
-d.
I did some tests, but the screen of debugger stay
Are you looking for a shell account to login to?
Brian
Jim Conner wrote:
> At 14:43 03.26.2002 +1000, senrong wrote:
>
>> I am a student who is new to Perl.and that my assignment is due this
>> following week...
>>
>> can anyone tell me where can I get a free server to run on my own
>> P
> > I have a string for example:
> >
> > "directory/subdirectory/subsubdirectory/filename.gz"
> >
> > How do I extract the filename.gz part for testing,
> > the number of subdirectories is not fixed?
>
> use File::Basename;
>
> my $file = "directory/subdirectory/filename.gz";
> print basename($
> I understand that by using:
>
> $s=~s/<[^>]*(?!.*?>)//
>
> the negative character class ( [^>]* ) seems redundant...
>
> But, strange, If I remove it (then we go to the one I wrote
> on my first
> message):
>
> $s=~s/<(?!.*?>)//
>
> it only removes the last orphan "<" character without
> I have a string for example:
>
> "directory/subdirectory/subsubdirectory/filename.gz"
>
> How do I extract the filename.gz part for testing,
> the number of subdirectories is not fixed?
use File::Basename;
my $file = "directory/subdirectory/filename.gz";
print basename($file);
Jonathan Paton
Hi
i have a string for example
"directory/subdirectory/subsubdirectory/filename.gz"
how do i extract the filename.gz part for testing, the number of
subdirectories is not fixed?
Stephen Redding
BT Ignite Solutions
Telephone - 0113 237 3393
Fax - 0113 244 1413
Email - [EMAIL PROTECTED]
British
On Tue, 2002-03-26 at 01:14, Ahmed Moustafa wrote:
> Jim Conner wrote:
> > At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote:
> >
> >>> Jim Conner wrote:
> >>>
> I suck at this kind of topic but the only way I can think of doing
> such a thing is this:
>
> Use IPC.
>
> >>>
From: "David Samuelsson (PAC)" <[EMAIL PROTECTED]>
> i got this line in an array allready, if i do a print off the array it
> prints this line.
>
> Last accessed 08-mar-02.10:27:55 by fdefgre.Domain
> [EMAIL PROTECTED]
>
> what i want to do now is only pick out the date that is the
> "08-mar-0
Try the GD module. Here is some code I have for creating thumbnails
(untested as it's stripped down from a bigger script). Thumbnails have a _
prepended to them. They're not great thumbs, there is no anti aliasing done
on them. For better image handling you'll need to look at the ImageMajick
(sp??
Hi,
This should work.
$_ = $your_string_array;
$_ =~ /accessed (.*?)\./;
$date = $1;
print $date;
Regards,
Mikael Larsson
-Ursprungligt meddelande-
Från: David Samuelsson (PAC) [mailto:[EMAIL PROTECTED]]
Skickat: den 26 mars 2002 11:53
Till: '[EMAIL PROTECTED]'
Ämne: reg exp help!
i
i got this line in an array allready, if i do a print off the array it prints this
line.
Last accessed 08-mar-02.10:27:55 by fdefgre.Domain [EMAIL PROTECTED]
what i want to do now is only pick out the date that is the "08-mar-02"
As it says in the manuals, one of the best with things with per
Hi all,
I need to be able to create thumbnails for a group of .jpg files overnight,
and I was wondering if there were any perl modules that anyone could suggest
for this one?
I'm going to take a stroll over to CPAN, but I believe personal experiences
always help.
--
Gary Stainburn
This em
[EMAIL PROTECTED] (David Gray) wrote in
01c1d435$f2306e60$[EMAIL PROTECTED]:">news:01c1d435$f2306e60$[EMAIL PROTECTED]:
>> >> I have strings like the following one:
>> >> my $s="The Library of > >>
>> >> I want to truncate the string, to become
>> >> "The Library of ..."
>> >> (that is
Thanks for your help.
In fact, the files I work with are binary file which contains alphanumériques
characters
which I want to recuperate .
The adequate solution to keep only the text editable is :
perl -pi -e 's/[^[:graph:]\n\s]//g' Myfile
Have a good day.
Franck.
--
To unsubscribe, e-mai
At 22:14 03.25.2002 -0800, Ahmed Moustafa wrote:
>Content-Type: text/plain; charset=us-ascii; format=flowed
>Content-Transfer-Encoding: 7bit
>X-Posted-By: 209.178.174.150
>
>Jim Conner wrote:
> > At 20:28 03.25.2002 -0800, Ahmed Moustafa wrote:
> >
> >>> Jim Conner wrote:
> >>>
> I suck at th
what type of server? are you looking for a web server? if so goto
www.apache.org and download it.
-Original Message-
From: senrong [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 25, 2002 11:43 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]
Subject: Help need fast
I am a student who is
Is there anyway to change the Default Input Record Separator.. or $/ .. to
allow me to read a character at a time?
I tried $/=~ /./; but it doesn't work.
Thanks,
Agustin Rivera
Webmaster, Pollstar.com
http://www.pollstar.com
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
54 matches
Mail list logo