hey,
i'm a c/c++ programmer struggling to pick up OO perl. i've been reading the
perltoot and i have question about the following:
package Person;
use strict;
sub new {
my $self = {};
$self->{NAME} = undef;
$self->{AGE}= undef;
$self->{PEERS} = []
christopher j bottaro said:
> hey,
> i'm a c/c++ programmer struggling to pick up OO perl. i've been reading
> the perltoot and i have question about the following:
Hopefully it won't be too much of a struggle. In contrast to C++, there
is little magic going on behind the scenes.
Read the sta
Hiya,
I'm in search for a solution. Let's say I have this array:
@array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
Now, how can I get the biggest integers from this array and give them a
string with their place. Let's say I have a foreach loop where I checked all
the biggest integers (however, I do
> -Original Message-
> From: Jeff Westman [mailto:[EMAIL PROTECTED]]
> Sent: Monday, December 09, 2002 10:49 PM
> To: [EMAIL PROTECTED]
> Subject: Package Syntax
>
>
> I usually see the last line in a package as
>
>1;
>
> Does this force the package to compile without error? What
>
> @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
>
> Now, how can I get the biggest integers from this array and
> give them a
> string with their place. Let's say I have a foreach loop
> where I checked all
> the biggest integers (however, I don't know how) and I give
> them all a
> string
On Tue, 10 Dec 2002, Mystik Gotan wrote:
> Hiya,
Please do not cross post.
>
> I'm in search for a solution. Let's say I have this array:
>
> @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
>
> Now, how can I get the biggest integers from this array and give them a
> string with their place. Le
From: "Mystik Gotan" <[EMAIL PROTECTED]>
> I'm in search for a solution. Let's say I have this array:
>
> @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
>
> Now, how can I get the biggest integers from this array and give them
> a string with their place. Let's say I have a foreach loop where I
> c
Forwarded Message From:"christopher j bottaro"
<[EMAIL PROTECTED]>Reply-to:[EMAIL PROTECTED]:[EMAIL PROTECTED]:help with
classes...Date:Tue, 10 Dec 2002 04:45:15 -0600MIME-Version:1.0Content-Type:text/plain;
charset="us-ascii"Content-Transfer-Encoding:7bitMessage-Id:<[EMAIL PROTECTED]>
Plain T
My box does not seem to have the Net::SSH::Perl installed. How can I get
it installed?
His Faithful Servant,
Mark-Nathaniel Weisman
President / CEO
Infinite Visions Educational Systems Inc.
Anchorage, Alaska
http://www.ivedsys.com
[EMAIL PROTECTED]
-Original Message-
From: zentara [mai
Title: Message
Attached is one of a
few (work in progress) scripts that I am creating to report on security events
in a M$ network. The issue I am having is, the second format, STDBODY is not
printing. Since STDBODY can contain many lines I even tried adding ~~
to the fieldline as suggested
Dear,
I'm looking for code bar generator in perl. Either someone knows where can I
find one or sending me a example?
Thanks in advance,
--
Cleiton Luiz Siqueira
Centro de Educação Monjolo
Fone: 520-1915
http://www.colegiomonjolo.com.br
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additio
Hi,
Can anyone tell me why this while loop would give me this error message?
while ( ($id) = $sth->fetchrow_array) {
$sth->execute();
@header_row = $sth->fetchrow_array;
## loop through the row array and print with comma space delimiters
## print two new lines at the end of the row for do
http://www.fairfieldcomputers.com/barcode/docs.html
Never used it though
>>> Cleiton Luiz Siqueira <[EMAIL PROTECTED]> 12/10/02
09:56AM >>>
Dear,
I'm looking for code bar generator in perl. Either someone knows where
can I
find one or sending me a example?
Thanks in advance,
--
Cleiton Luiz
Maybe you're trying to accomplish this:
while ($id == $sth->fetchrow_array) {
I'm pretty sure this will cause the error you're looking for.
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EMAIL PROTECTED]
From: Robbie Staufer <[EMAIL PROTECTED]>
To: [EMA
This one is good, Ive played with it before and there are no modules to
install:
http://www.barcodemill.com/
>>> Cleiton Luiz Siqueira <[EMAIL PROTECTED]> 12/10/02
09:56AM >>>
Dear,
I'm looking for code bar generator in perl. Either someone knows where
can I
find one or sending me a example?
T
Thanks. Problem solved.
Robbie
Mystik Gotan wrote:
> Maybe you're trying to accomplish this:
>
> while ($id == $sth->fetchrow_array) {
>
> I'm pretty sure this will cause the error you're looking for.
>
> --
> Bob Erinkveld (Webmaster Insane Hosts)
> www.insane-hosts.net
> MSN: [EM
Is anyone aware of a Perl module, script, etc. which can perform an
automatic download (similar to lynx)?
So say, I want to download and process the contents of the excel file at
the following site:
http://www.census.gov/indicator/www/m3/adv/table1a.xls
With Perls' ParseExcel module, I am able t
Hi,
Is there a way to refer to the first row of a database (row 0?) ?
For example, the first row of my database contains header information.
I want the header row to print out first whenever data is requested, so
the output file looks like this:
header, header, header, header, header
data, data
From: <[EMAIL PROTECTED]>
> Is anyone aware of a Perl module, script, etc. which can perform an
> automatic download (similar to lynx)?
>
> So say, I want to download and process the contents of the excel file
> at the following site:
> http://www.census.gov/indicator/www/m3/adv/
Howdy:
I'm having problems trying to parse out part
of a directory into variables.
I start with this:
[snip script]
/usr/local/bin/perl -w
use diagnostics;
my $dest="/i/'Depression Management'/Mailing/dec2002_iso_images";
# Where is data coming from?
my $source="/i/'Depression Management'/Ma
Hi Shaunn
What exactly are you getting? because this looks like it should work, except
that your value for $source doesn't match the directories listed in the
results.
A couple of points though. This won't work in general, because if $source
contains any special regex characters then it will beha
Yo, Mark,
On Mon, 9 Dec 2002, Mark Goland wrote:
> Ok I got it working now, thanx much Jason. Only question I have is
> regarding this.
Good! Glad I could help.
> $head ||= $link;
This is a Perl idiom to set a variable if it hasn't already been set.
So, if $head == undef, then $head will
Not sure if this will help, but something like this would work...
foreach ( `ls -d1 $source/06/*` ) { # each line of output goes into $_
@group = split(m|/|, $_); # split out filename parts
$pcgname = pop(@group); # gets filename
$bu = pop(@group); #
Here is what I am trying to do. I want to read all the files in a
directory searching for a specific string, if the string is found I want
it to be either changed or deleted depending on what I enter as a
replacement string. I know I can do it by putting the output to a
separate file and then jus
thanks to both of yall for the explanations. so bless() is is where the magic
happens? once something is given a type, then those subs become methods and
a ref of the calling object is implicitly giving as the first arg? i see
now, thats what i was missing before. everything is much more cle
Hi,
Anyone know how to write a grep -C in Perl ?
You know, I want to search for a string/regexp in a file and I want to
print the line before and the line after the search string.
I've tried a couple of ways and it takes a really long time, I load the
file in memory, seach for the string, extr
I have an array that I want to generate a new hash for each item that is
the first array. I want the new hashes to be named as the 1st array. Wow
I am confused reading that. Example ...
I am using Config::IniFiles
I place all the sections from the ini file into an array. I then want a
new hash fo
> I have an array that I want to generate a new hash for each item that is
> the first array. I want the new hashes to be named as the 1st array. Wow
> I am confused reading that. Example ...
Yes it is.
> I am using Config::IniFiles
I haven't used it, so I can't give you any module specific hel
hmm, i have more questions now. how does one make class methods vs object
methods?
using the example from the tutorial...
package Person;
use strict;
sub new {
my $self = {};
$self->{NAME} = undef;
$self->{AGE}= undef;
$self->{PEERS} = [];
>Anyone know how to write a grep -C in Perl ?
Why not just store the previous line, then when you have a match,
print it, the matching line, then set a flag to print the next line as well?
Something along the lines of:
while ($line = ) {
if ($print_next) {
Hi,
Reading further in the archives to this list I got an idea: (thanks to
John W. Krahn)
#!/usr/bin/perl
$pattern = shift(@ARGV);
while (<>) {
if ( /$pattern/i ){
print $reml;
print $_;
$_ = <>;
print "$_\n";
}
Another option would be to use the Perl version of grep from the PPT (Perl
Power Tools) project.
PPT Home
http://www.perl.com/language/ppt/
tcgrep Source
http://www.perl.com/language/ppt/src/grep/tcgrep
tcgrep Perldoc
http://www.perl.com/language/ppt/src/grep/tcgrep.html
Rob
-Original Mes
I assume you have done your required reading:
in the perldocs:
perlbootPerl OO tutorial for beginners
perltootPerl OO tutorial, part 1
perltootc Perl OO tutorial, part 2
perlobj Perl objects
perlbot
> -Original Message-
> From: Dylan Boudreau [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, December 10, 2002 3:04 PM
> To: [EMAIL PROTECTED]
> Subject: Putting output back in the same file it came from
>
>
> Here is what I am trying to do. I want to read all the files in a
> directory searc
Shaunn Johnson wrote:
>
> Howdy:
Hello,
> I'm having problems trying to parse out part
> of a directory into variables.
>
> I start with this:
>
> [snip script]
>
> /usr/local/bin/perl -w
> use diagnostics;
>
> my $dest="/i/'Depression Management'/Mailing/dec2002_iso_images";
>
> # Where is
Dylan Boudreau wrote:
>
> Here is what I am trying to do. I want to read all the files in a
> directory searching for a specific string, if the string is found I want
> it to be either changed or deleted depending on what I enter as a
> replacement string. I know I can do it by putting the outpu
If you are using Oracle 8.i or greater, you can do:
select * from yourTable
where rownum < 2
JW
--- Robbie Staufer <[EMAIL PROTECTED]> wrote:
> Hi,
>
> Is there a way to refer to the first row of a database (row 0?) ?
>
> For example, the first row of my database contains header infor
Hi, Jerry, :)
On Tue, 10 Dec 2002, Jerry Rocteur wrote:
> Anyone know how to write a grep -C in Perl ?
Here is a script that mimics just the '-C' feature of GNU grep. It
doesn't support the fanciness of printing filenames when multiple
input files are specified.
This may be overkill for your s
instead of setting my own $error can I instead just check if &mount
completed ok? Is there a better way to do this?
Code Snip
-
Foreach loop
...
&mount;
next if ($error == 1);
mkdir "//backup/$ini{$section}{machine}" unless (-e
"/backup/$ini{$section}{machin
Jerry Rocteur wrote:
>
> Hi,
Hello,
> Anyone know how to write a grep -C in Perl ?
Yes, someone definitely does:
http://www.perl.com/language/ppt/src/grep/index.html
> You know, I want to search for a string/regexp in a file and I want to
> print the line before and the line after the search
Yes, just return a true (1) or false (0) value...
foreach (@junk) {
next unless mount(); # next on error
... do stuff ...
}
sub mount{
... do stuff ...
return $return_code;
}
...OR...
sub mount{
... do stuff ...
# return the negated return value
return ! system(...);
}
...OR...
On Dec 10, Paul Kraus said:
>instead of setting my own $error can I instead just check if &mount
>completed ok? Is there a better way to do this?
Sure.
>sub mount{
>!system
>"mount","-t","smbfs","-o","username=$ini{$section}{username},password=$i
>ni{$section}{password}",
>
>"//$ini{$sec
"Christopher J Bottaro" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hey,
> i'm a c/c++ programmer struggling to pick up OO perl. i've been reading
the
> perltoot and i have question about the following:
>
> package Person;
> use strict;
>
> sub new
Here it is in CSV (comma separated values). it's not very much - $246
Date,Amount,Description,Location
10.08.02,100.52,"Business Cards - Mark, Me",Designyourowncard.com
10.22.02,50.26,Business Cards - Lorraine,Designyourowncard.com
10.22.02,31.28,Lunch - Mark & Lorraine,Claim Jumper
10.25.02,64.60,
"Christopher J Bottaro" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> hmm, i have more questions now. how does one make class methods vs object
> methods?
>
> using the example from the tutorial...
> sub name {
> my $self = shift;
> if (@
"John W. Krahn" wrote:
>
> my $before = 1;
> my $after = 1;
> my @buffer;
>
> while ( my $line = ) {
>
> push @buffer, $line;
>
> shift @buffer if $#buffer > $before + $after;
>
> next if $#buffer < $before;
>
> if ( $buffer[ $before ] =~ /found matching regex/ ) {
>
>
Mark Anderson wrote:
No you don't. Sorry. Someone else hopefully will post the link to the
column that someone wrote that would tell you why.
Are you referring to the following:
http://perl.plover.com/varvarname.html
Came across it in my other travels looking for information about forki
Mark,
This is a pain to install. I would do it thru CPAN.
perl -MCPAN -e shell
cpan>install Net::SSH::Perl
I fyou don't have root access to install perl modules, try to use
Net::SSH.
use strict;
use warnings;
use Net::SSH qw( sshopen3 );
my $user = "bob";
my $host = "10.10.10.10";
my $
I'm not sure I understand your whole question, but
the easiest way to find the largest integers is
to sort your array in reverse numeric order:
my @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
my @sorted = sort {$b <=> $a } @array;
Now @sorted should contain:
(298023, 456, 89, 56, 7, 6, 5, 1, 0)
Mystik Gotan said:
Careful with the crossposting. This has nothing to do with CGI, and I
don't suppose my post will even get to the yahoo list.
> I'm in search for a solution. Let's say I have this array:
>
> @array (5, 6, 7, 89, 1, 0, 456, 298023, 56);
>
> Now, how can I get the biggest intege
Try making a numberLposition hashas you iterate through the array, add each number as
a key and the position in the array as the value. Then use sort($keys(%hash)) to
order them. I'm a newbie, also, so I'm not sure if sort has an optional parameter for
order, though. You'll have to explore th
Use the sort function:
print sort @array;
and for largest number first use:
print reverse sort @array;
For your particular problem:
@sorted_array = reverse sort @array;
foreach (@sorted_array)
{
# whatever you want to do with each number
Oh, no, actually, I know quite about Perl. The problem is, I hardly have got
any experience in programming, I read a lot. I've got 3 perl books and
wasn't just thinking at the idea of using sort(). Thanks guys.
--
Bob Erinkveld (Webmaster Insane Hosts)
www.insane-hosts.net
MSN: [EM
Any idea how you return an exitcode after the
$client->process step is completed?
According to the perldoc, there isn't really any way to do this. I'm hoping
for a loophole of sorts.
--
FORCE YOURSELF TO RELAX!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
Hi!
I want to know which package I'm in?
Any help?
package go
print "Now I'm here: ??PACKAGE??\n" # <- ??PACKAGE?? can be replaced by?
Thanks! :-)
trond
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
perldoc -f caller
- Original Message -
From: "Trond Hagen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, December 11, 2002 1:09 AM
Subject: Which package am I in ?
> Hi!
>
> I want to know which package I'm in?
> Any help?
>
> package go
>
> print "Now I'm here: ??PACKA
56 matches
Mail list logo