Hi,
As my network program on sun solaris was giving
problem with the error:
malformed header from script. Bad header=BLASTN 2.2.4
[Aug-26-2002]: /usr/local/apache/cgi-bin/local/
file3.cgi
I tried with another linux machine it worked fine.
That is, after sending the request to the linux
machine I
Hi everyone,
I'm a hopeless hacker of Perl, and I tend to think in AWK-ish ways, simply
because I know awk loads better than Perl.
Awk has unfortunately taught me to think purely in terms of fields...
If I have a text file where the field separator is a new line and the record
separator is a blan
I'm having a problem splitting a variable and need some help. What I have is
some variables with a name, and then information in parens. A couple examples:
$data = "David (man from uncle)";
$data = "John Doe (The boy down the hall)";
What I want to do is split $data into two string variab
Hi,
Somethig like this should work (untested):
my ( $name, $info ) = split /\(/, $data;
regards, Aim.
[EMAIL PROTECTED] wrote:
> I'm having a problem splitting a variable and need some help. What I have is
> some variables with a na
Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
> $data = "David (man from uncle)";
>
> $data = "John Doe (The boy down the hall)";
>
> What I want to do is split $data into two string variables, one holding the
> $name, and the other holding all the $info that is within the parens. How
Hi Dennis.
Dennis Warren wrote:
> Hi everyone,
>
> I'm a hopeless hacker of Perl, and I tend to think in AWK-ish ways, simply
> because I know awk loads better than Perl.
What do you mean by 'awk loads better'? Beware that my Unix isn't
especially strong!
> Awk has unfortunately taught me to thi
Hello,
thank you all, at this moment I don't need a solution involving
anything neither nuclear fly swatters: I show the hammer to the bolt
and that became a nail.
I needed something a bit more kinky that I told you in the first mail -
to delete all the posts too much short in a very long newsgr
Janek Schleicher wrote:
> Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
>
> > $data = "David (man from uncle)";
> >
> > $data = "John Doe (The boy down the hall)";
> >
> > What I want to do is split $data into two string variables, one holding the
> > $name, and the other holding all the
Janek Schleicher wrote:
>
> Jimstone7 wrote at Thu, 27 Mar 2003 06:39:25 -0500:
>
> > $data = "David (man from uncle)";
> >
> > $data = "John Doe (The boy down the hall)";
> >
> > What I want to do is split $data into two string variables, one holding the
> > $name, and the other holding all
Hi, I need some help working with strings. Suppose that I have $block
that's a string of 512 bytes.
1) How can I have only one byte from it (i.e. i want the third byte)? 2) How
can I get the first n bytes of the string in another string (substring),
deleting them from the beginning of the origi
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
Hi everyone,
I am using the win32 environment (Windows 2000 SP3 specifically):
Could anyone tell me how I could use perl to edit the registry? Do I need
some kind of module? Is there a website or link anyone can provide?
TIA,
Leon
-BEGIN P
Christian Calónico wrote:
>
> Hi, I need some help working with strings. Suppose that I have $block
> that's a string of 512 bytes.
> 1) How can I have only one byte from it (i.e. i want the third byte)? 2) How
> can I get the first n bytes of the string in another string (substring),
> deleting t
If I'm reading from a file (suppose that it haves 1124 bytes) in this way:
open IN, "data2.txt" or die $!;
$/ = \512;
while( my $block = )
{
...
}
1) Two iterations reads 1024 bytes. The third iteration is possible? How can
I read the last 100 bytes?
2) Is there any way to change dinamically $/
From: "Rosenstein, Leon" <[EMAIL PROTECTED]>
> I am using the win32 environment (Windows 2000 SP3 specifically):
>
> Could anyone tell me how I could use perl to edit the registry? Do I
> need some kind of module?
Yes. You can use either Win32::Registry, Win32API::Registry and
Win32::TieRegistr
From: Christian Calónico <[EMAIL PROTECTED]>
> If I'm reading from a file (suppose that it haves 1124 bytes) in this
> way:
>
> open IN, "data2.txt" or die $!;
> $/ = \512;
> while( my $block = )
> {
> ...
> }
>
> 1) Two iterations reads 1024 bytes. The third iteration is possible?
> How can I rea
Christian Calónico wrote:
> If I'm reading from a file (suppose that it haves 1124 bytes) in this
> way:
>
> open IN, "data2.txt" or die $!;
> $/ = \512;
> while( my $block = )
> {
> ...
> }
>
> 1) Two iterations reads 1024 bytes. The third iteration is possible?
> How can I read the last 100 b
I think I'm right, but I want to verify it. I'm learning PERL on my own
and "decomposing" some programs to see how they "flow". My question is -
given the following program "structure", what will print out?
Print "one"
Subroutine aa
print "two"
End
Print "three"
Print "four"
Subroutine bb
pr
Here you go, and your guess as to what prints out is right on; subroutines
don't run until they're called, and placement in this situation doesn't
affect anything.
#!/usr/bin/perl -w
use strict;
print "one\n";
sub aa {
print "two\n";
}
print "three\n";
print "four\n";
sub bb {
prin
Stefan Lidman wrote at Thu, 27 Mar 2003 13:55:27 +0100:
> Janek Schleicher wrote:
>> I would use a regexp:
>>
>> my ($name, $info) = $data =~ /(.*?)\w+\((.*)\)/;
>
> I guess you ment:
> my ($name, $info) = $data =~ /(.*?)\s*\((.*)\)/;
Yep.
Cheerio,
Janek
--
To unsubscribe, e-mail: [EMAIL PR
Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +:
> Janek Schleicher wrote:
>> > $data = "David (man from uncle)";
>> >
>> > $data = "John Doe (The boy down the hall)";
>> >
>> > What I want to do is split $data into two string variables, one holding the
>> > $name, and the other holding all
Janek Schleicher wrote:
> Rob Dixon wrote at Thu, 27 Mar 2003 12:51:46 +:
>
> >
> > I'm afraid your regex is wrong! It does the following:
>
> Yep, it was a typo and untested.
>
> > capture zero or more (as few as possible) of any character
> > !! match one or more 'word' characters follow
Thanks Rob, that helps me.
>What do you mean by 'awk loads better'?
I mean that I know awk better than I know Perl.
In this context 'loads' means 'a lot', rather than transfer into memory or
any other such computerese.
BTW I found I could also do it in the following way the following, but I
knew
Dennis Warren wrote:
> Thanks Rob, that helps me.
>
> > What do you mean by 'awk loads better'?
> I mean that I know awk better than I know Perl.
> In this context 'loads' means 'a lot', rather than transfer into memory or
> any other such computerese.
Ah! Sorry - I guess I expected the other leam
Richard C 1 wrote:
> I think I'm right, but I want to verify it. I'm learning PERL on my own
> and "decomposing" some programs to see how they "flow". My question is -
> given the following program "structure", what will print out?
>
> Print "one"
> Subroutine aa
> print "two"
> End
> Print "thre
Hello,
Got a little issue. Tyring ot under stand how things work but just not
getting it. I am forking each element of the array . I have a maximum child
count of 8. Which works. What I was wondering is if I get into the if
statement in the until loop. How do I exit the pid clean up a
Hi Chad.
Chad Kellerman wrote:
> Hello,
>
>Got a little issue. Tyring ot under stand how things work but just not
> getting it. I am forking each element of the array . I have a maximum child
> count of 8. Which works. What I was wondering is if I get into the if
> statement in the until
Hi All,
I writting a script so when members join my program it writes their Email Address
into a flat file.
I have it adding to the file this way.
open (FILE, ">>$cgiroot/memdata/address/members.txt");
flock(FILE, 2);
print FILE "$list\n";
flock(FILE, 8);
close (FILE);
What I need to know, and
Palm Optins wrote:
> Hi All,
>
> I writting a script so when members join my program it writes their Email Address
> into a
> flat file.
> I have it adding to the file this way.
>
> open (FILE, ">>$cgiroot/memdata/address/members.txt");
> flock(FILE, 2);
> print FILE "$list\n";
> flock(FILE, 8);
Hello.
I need to know how to remove a substring from a string and a how
to remove a simple character occurrence from a string. Thanks in advance!
Christian.
_
Charla con tus amigos en línea mediante MSN Messenger:
http://messenger.y
Palm Optins wrote:
> Hi All,
>
> I writting a script so when members join my program it writes their Email Address
> into a
> flat file. I have it adding to the file this way.
It's better to do
use Fcntl ':flock';
to get the names for the different lock vakues, then you can write:
> open
>
>
> Hello.
> I need to know how to remove a substring from a string and a how
> to remove a simple character occurrence from a string. Thanks
> in advance!
> Christian.
>
perldoc -f substr
perldoc -f splice
perldoc perlre
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comma
On Thu, 27 Mar 2003, Palm Optins wrote:
> I writting a script so when members join my program it writes their
> Email Address into a flat file. I have it adding to the file this way.
>
> open (FILE, ">>$cgiroot/memdata/address/members.txt");
> flock(FILE, 2);
> print FILE "$list\n";
> flock(FILE,
Rob,
Thanks for the help. I did what you suggested and cleaned up the code.
But I am getting some strange errors:
Use of uninitialized value in numeric gt (>) at ./script.pl line #.
foreach $hostId ( @hostIds ) {
my $pid = undef;
Chad Kellerman wrote:
> Rob,
>
>Thanks for the help. I did what you suggested and cleaned up the code.
> But I am getting some strange errors:
>
> Use of uninitialized value in numeric gt (>) at ./script.pl line #.
>
> foreach $hostId ( @hostIds ) {
>
> my $pid = undef;
>
> $pid = fork
--- Original message ---
foreach $hostId ( @hostIds ) {
my $pid = undef;
$pid = fork if $CHILD_PIDS < $MAX_CHILDREN;
if( $pid > 0 ) {
$CHILD_PIDS++; #Add the children up until we hit the
I can resolve a constant in a print statement like so:
use constant QX12_FILE => "q_x12_in.dat";
...
print STDERR "could not change permissions on file @{[ QX12_FILE ]}: $!";
but how to resolve the constant when being used in a function call, like so:
use constant QX12_FILE => "q_x12_in.dat";
..
From: Tony Esposito <[EMAIL PROTECTED]>
> I can resolve a constant in a print statement like so:
>
> use constant QX12_FILE => "q_x12_in.dat";
> ...
> print STDERR "could not change permissions on file @{[ QX12_FILE ]}:
> $!";
>
> but how to resolve the constant when being used in a function call
I'm sure there are more elegant soultions, but this works:
perl -e '
@x = qx(stty -a);
@y = split(/\s/, $x[1]);
$y[2] =~ s/;//;
print "screen size is $y[2] x $y[5]"
'
"stty -a" works on every *nix system I know. Some systems have 'stty -size'
to help with exactly what you are asking.
Jenda Krynicky wrote:
> From: Tony Esposito <[EMAIL PROTECTED]>
> > I can resolve a constant in a print statement like so:
> >
> > use constant QX12_FILE => "q_x12_in.dat";
> > ...
> > print STDERR "could not change permissions on file @{[ QX12_FILE ]}:
> > $!";
> >
> > but how to resolve the const
Thanks for all your input. I have used one of these methods and it worked
well.
Problem solved :-)
> Anthony (Tony) Esposito
> Senior Technical Consultant
> Inovis(tm), formerly Harbinger and Extricity
> 2425 N. Central Expressway, Suite 900
> Richardson, TX 75080
> (972) 643-3115
> [EMA
In a message dated 3/27/03 5:41:14 PM Eastern Standard Time,
[EMAIL PROTECTED] writes:
> perl -e '
> @x = qx(stty -a);
> @y = split(/\s/, $x[1]);
> $y[2] =~ s/;//;
> print "screen size is $y[2] x $y[5]"
> '
>
> "stty -a" works on every *nix system I know. Some systems have 'stty -siz
Good info Peter.
As a side note too, this group is about "beginners", or basic perl, or those
things pertaining to perl that we all need help on every now and then. I
don't think the focus is CGI programming per se, but perl in general. It's a
great group, and I personally have benefited tremend
[EMAIL PROTECTED] wrote:
>
> In a message dated 3/27/03 5:41:14 PM Eastern Standard Time,
> [EMAIL PROTECTED] writes:
>
> > perl -e '
> > @x = qx(stty -a);
> > @y = split(/\s/, $x[1]);
> > $y[2] =~ s/;//;
> > print "screen size is $y[2] x $y[5]"
> > '
> >
> > "stty -a" works on every *nix
$TheOriginalString =~ s/$StringOrCharToRemove//g;
Tor.
Christian Calónico wrote:
>
> Hello.
> I need to know how to remove a substring from a string and a how
> to remove a simple character occurrence from a string. Thanks in advance!
> Christian.
>
> _
Hello everyone,
I imagine you see emails like this frequently, but I am looking for some
tips. I'd like to know some good technics for beginners to perl, and what
steps they should take to get involved and start to understand the basic
concepts of perl, if anyone could reply with how they star
An excellent starting point is the camel book, "Learning Perl", by Randal
Schwartz & Tom Christiansen. Don't let the title fool you -- it's a solid
reference too
--- Todd <[EMAIL PROTECTED]> wrote:
> Hello everyone,
>
> I imagine you see emails like this frequently, but I am looking for so
hi all,
I am having a problem with duping stdout and socket. When my client forks of children,
the childrens stdout is then duped with a socket. Which is what I want, but for some
reason the parents stdout gets redirected as well. I want the parents STDOUT to stay
the same and only redirect chi
Hi all,
i am new to perl and i want to use it with DBI:mysql module. I want to
connect to my sql server and do some data manipulation like , insert,
update and delete. I read the DBI documention but i cant get through to get
my script working. any help is needed. below is my script.
#!/usr/bin
Hi
This is a typical situation in companies with development teams spread
around the globe.
I have FTP servers - in India , US & Switzerland.
Builds are being made in India and being put on the Indian server.
Any tips how I could transfer the contents to the remote servers ?
I've been using Ne
I just started learning perl with this book and looks very very good.
-Original Message-
From: Jeff Westman [mailto:[EMAIL PROTECTED]
Sent: Friday, March 28, 2003 9:17 AM
To: beginners
Subject: Re: hello
An excellent starting point is the camel book, "Learning Perl", by Randal
Schwartz &
50 matches
Mail list logo