Hello,
I don't think that the file matters. You say it's a massive line. To read a
file you should first open it. Look at PerlDoc.
"Desmond Lee" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> Hi guys
>
> I'm trying to read a file, but it's just one massive l
On Tue, 23 Jul 2002, Manya wrote:
>
> > Have you installed Net::SMTP, it comes as a part of libnet package.
> > If you have installed it check that the install directory is a
> > part of the @INC array.
> >
>
> How to check if a module is installed or not ?
If you are getting an error like 'Ca
Nkuipers <[EMAIL PROTECTED]> wrote:
>
> or something along those lines. in any case I have been under the
> impression that calls to the system are more appropriately made like
> this:
>
> system "date";
>
> than this:
>
> `date`
>
> though I can't remember what gave me that impression. =)
Thanks Jenda and George,
Considering the hosting company is a rather large conglomerate, and their
answer to any question I have regarding databases is to send me to their
helpfile, which does not mention databases or Perl anywhere, it might be
time to change who I am giving my monthly fees to...
>
> Could you ask them if they would install (or have already installed)
> DBI and DBD::CSV or DBD::File?
> You could then convert your database to flat files or CSVs on your
> side (by a Perl script that would just connect the Access via
> DBD::ODBC, the CSVs/Files, and would copy all tables
Manya wrote:
>>Have you installed Net::SMTP, it comes as a part of libnet package.
>>If you have installed it check that the install directory is a
>>part of the @INC array.
>>
>
>
> How to check if a module is installed or not ?
>
Depends on what system you are on. In your original message t
Ick.
If you want to shell program you should just program shell. How about:
my $log="/tmp/ito.log";
open LOG, ">$log";
chomp (my $date = scalar localtime);
print LOG "[$date] Warning: some text\n";
On Tuesday, July 23, 2002, at 06:43 PM, kent ho wrote:
> Please help. I want to expand the "da
>$log="/tmp/ito.log"
>`echo Warning: some text > $log`
>
>I need to expand the "date" command somewhere in this echo command, please
>show me how.
the perl localtime function returns the same information as a unix date
command. printing to an append filehandle in perl is similar to echoing to a
Please help. I want to expand the "date" command in the echo command:
Ex:
$log="/tmp/ito.log"
`echo Warning: some text > $log`
I need to expand the "date" command somewhere in this echo command, please
show me how.
Thanks,
kent
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional com
> Even better option might be DBD::SQLite. That's a "whole" SQL
> compatible database in Perl module. It is quicker than
> DBD::CSV/DBD::File and the whole database is just one file, just like
> Access.
Wow, learn something new everyday. Very cool.
>
> That way you do not have to upload tens of
I'm putting this back on-list since other people may be interested in
continuing this thread.
If you already have all this information in an access db and you like
access, I would recommend finding a hosting provider that will host your
access app. Alternatively, a provider that would provide
From: "Garry" <[EMAIL PROTECTED]>
> I sure hope I am posting in the right place, the "beginners"
> definitely applies here.
>
> I have a web hosting account and my ISP has the following Perl modules
> installed:
>
> AnyDBM_File,pm
> db_file
> NDBM_File.pm
> ODBM_File.pm
> SDBM_File.pm
> gdbm_fil
On Tuesday, July 23, 2002, at 04:06 PM, Garry wrote:
> Hello everyone,
>
> I sure hope I am posting in the right place, the "beginners" definitely
> applies here.
>
> I have a web hosting account and my ISP has the following Perl modules
> installed:
>
> AnyDBM_File,pm
> db_file
> NDBM_File.pm
>
To make a comment more to your intent, I just installed
Crypt::Cracklib. It seems to work fine. It's not particularly slow, so
unless there is a reason you want to supplement it, I would just run
with the cracklib checks.
On Tuesday, July 23, 2002, at 04:10 PM, George Schlossnagle wrote:
>
Hello everyone,
I sure hope I am posting in the right place, the "beginners" definitely
applies here.
I have a web hosting account and my ISP has the following Perl modules
installed:
AnyDBM_File,pm
db_file
NDBM_File.pm
ODBM_File.pm
SDBM_File.pm
gdbm_file perl5db.pl
They have a statement on th
On Mon, Jul 22, 2002 at 11:13:23PM -0700, nkuipers wrote:
> What I am about to raise, I do so more out of wanting someone to educate me
> than disagreeing for the sake of. The *that syntax shown below is unfamiliar
> to me outside the context of referencing a filehandle in a subroutine params
Probably not the input you're looking for but: If your page is in php,
why are you passing it to a perl script? Having to maintain things in
two languages is a pain, you invariably end up with large amounts of
duplicated code. Maintaining redundant code in 1 language is hard
enough, maintai
I just checked CPAN
and found:
http://search.cpan.org/doc/DANIEL/Crypt-Cracklib-0.01/Cracklib.pm
and there is a good example right there, but there isn't much documentation.
That's all the input I can supply.
> -Original Message-
> From: Batchelor, Scott [mailto:[EMAIL PROTECTED]]
> Sen
Anyone have any input on this?
Scott
-Original Message-
From: Batchelor, Scott
Sent: Tuesday, July 23, 2002 12:07 PM
To: [EMAIL PROTECTED]
Subject:Crypt::Cracklib?
Does anyone have any experience with this module?
Basically I have a PHP page which is passing a u
"John W. Krahn" wrote:
>
> "Shishir K. Singh" wrote:
> > >
> > > I was just wondering if there is anything similar
> > > in perl for unix commands pushd / popd ??
> >
> > > pushd and popd are built-in shell commands, they aren't really "Unix"
> > >commands. What exactly are you trying to do?
>
I get it. Thank you
use File::Basename;
my $os_string = "MSWin32";
fileparse_set_fstype($os_string);
my $fullfilename = "c:\\windows\\system32\\kernel32.dll";
my ($name,$path,$suffix) = fileparse($fullfilename, '\..*');
$suffix =~ s/\.//g;
print "$name\n" . "$path\n" . "$suffix\n";
--
To unsubs
Thanks to all that posted... very informative.. and helpful.
David Gerler
Gerler Enterprises
PO BOX 16357
Chesapeake VA 23328
http://www.GerlerEnterprises.com/
Nationwide Dial-up from $12.45
http://www.EasySitesForLess.com/
-Original Message-
From: Jeff 'japhy' Pinyan [mailto:[EMAIL PR
On Tuesday, July 23, 2002, at 11:39 , Shishir K. Singh wrote:
[..]
> I have this awfully old shell script that used lots of pushd and popd and
> I need to convert it to perl. I will have to settle with push and pop and
> cwd for the time being. Thanks anyways !!
traditionally pushd/popd are cs
Thanks John...I appreciate it!!
> >
> > I was just wondering if there is anything similar
> > in perl for unix commands pushd / popd ??
>
> > pushd and popd are built-in shell commands, they aren't really "Unix"
> >commands. What exactly are you trying to do?
>
> >perldoc -f push
> >perldoc -
"Shishir K. Singh" wrote:
> >
> > I was just wondering if there is anything similar
> > in perl for unix commands pushd / popd ??
>
> > pushd and popd are built-in shell commands, they aren't really "Unix"
> >commands. What exactly are you trying to do?
>
> >perldoc -f push
> >perldoc -f pop
>
> Given a full pathname c:\windows\system32\kernel32.dll
>I need to parse this into a directory, file, and extension
>my $fullfilename = "c:\\windows\\system32\\kernel32.dll";
>breaks down into the following
>my $dir = "c:\\windows\\system32\\";
>my $file = "kernel32";
>my $ext = "dll";
Fil
>= Original Message From chris <[EMAIL PROTECTED]> =
>Given a full pathname c:\windows\system32\kernel32.dll
>
>I need to parse this into a directory, file, and extension
>
>my $fullfilename = "c:\\windows\\system32\\kernel32.dll";
>
>breaks down into the following
>
>my $dir = "c:\\window
Given a full pathname c:\windows\system32\kernel32.dll
I need to parse this into a directory, file, and extension
my $fullfilename = "c:\\windows\\system32\\kernel32.dll";
breaks down into the following
my $dir = "c:\\windows\\system32\\";
my $file = "kernel32";
my $ext = "dll";
--
To unsub
Thanks Shawn, but I need to basically split the string into two strings
between the words. I need to put the second half of the string into another
string.
That may help with some future scripts though. Thanks for pointing it out.
David Gerler
Gerler Enterprises
PO BOX 16357
Ches
>= Original Message From "Balint, Jess" <[EMAIL PROTECTED]> =
>Hello. What is wrong with this?
>
>perl -e 'for(1..300){sleep 1;print ".";}'
>
>It never prints anything.
>Thanks.
I wrote a script like this:
for (1..5) {
sleep 1;
print ".";
}
when i ran it, i timed it. it took
On Jul 23, Balint, Jess said:
>Is there a command line switch for that?
To automatically place a newline after every print(), use the -l switch.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmonks.org/ http://www.cpan
STDOUT is line-buffered. either unbuffer it ($| = 1;) or use stderr
perl -e 'for(1..300){sleep 1;print STDERR ".";}'
On Tuesday, July 23, 2002, at 02:37 PM, Balint, Jess wrote:
> Hello. What is wrong with this?
>
> perl -e 'for(1..300){sleep 1;print ".";}'
>
> It never prints anything.
> Thank
On Jul 23, Jeff 'japhy' Pinyan said:
> if (length($str) > 85) {
>$str =~ s/(.{0,85})(?<=\S)(?!\S).*/$1/s;
> }
That can be
$str =~ s/(.{0,84}\S)(?!\S).*/$1/s;
> use Regexp::Keep;
> $str =~ s/.{0,85}\K(?<=\S)(?!\S).*//s;
And that would be
$str =~ s/.{0,84}\S\K(?!\S).*//s;
The Rege
Is there a command line switch for that?
-Original Message-
From: Nikola Janceski [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 2:50 PM
To: 'Balint, Jess'; '[EMAIL PROTECTED]'
Subject: RE: One Liner Problems
output is buffered.
try it like this
perl -e 'for(1..300){sleep 1;pr
output is buffered.
try it like this
perl -e 'for(1..300){sleep 1;print ".\n";}'
> -Original Message-
> From: Balint, Jess [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 2:37 PM
> To: '[EMAIL PROTECTED]'
> Subject: One Liner Problems
>
>
> Hello. What is wrong with this?
>
On Jul 23, Balint, Jess said:
>Hello. What is wrong with this?
>
>perl -e 'for(1..300){sleep 1;print ".";}'
>
>It never prints anything.
>Thanks.
Yes it does. It prints
".
>I figure that I can use substr() to cut up a string, but how do I make it
>between words?
you can split the string on whitespace, for one.
my @array = split /\s+/, $string;
>How do I measure a string to see if it is greater than 85 characters?
my $string_len = length($string);
>Basically, if
On Jul 23, David Gerler said:
>How do I measure a string to see if it is greater than 85 characters?
Using length().
if (length($str) > 85) { ... }
>Basically, if the string is more than 85 characters, how do I break it at
>the last full word?
Well, it depends what you call a "word". Let's
Hello. What is wrong with this?
perl -e 'for(1..300){sleep 1;print ".";}'
It never prints anything.
Thanks.
Jess
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
David Gerler wrote:
>
> I figure that I can use substr() to cut up a string, but how do I make it
> between words?
>
> How do I measure a string to see if it is greater than 85 characters?
>
> Basically, if the string is more than 85 characters, how do I break it at
> the last full word?
$stri
>
> I was just wondering if there is anything similar
> in perl for unix commands pushd / popd ??
> pushd and popd are built-in shell commands, they aren't really "Unix"
>commands. What exactly are you trying to do?
>perldoc -f push
>perldoc -f pop
>perldoc -f shift
>perldoc -f unshift
>perld
"Shishir K. Singh" wrote:
>
> I was just wondering if there is anything similar
> in perl for unix commands pushd / popd ??
pushd and popd are built-in shell commands, they aren't really "Unix"
commands. What exactly are you trying to do?
perldoc -f push
perldoc -f pop
perldoc -f shift
perldo
Check out Text::Wrap on CPAN.
http://search.cpan.org/doc/MUIR/Text-Tabs+Wrap-2001.0131/lib/Text/Wrap.pm
Shawn
- Original Message -
From: "David Gerler" <[EMAIL PROTECTED]>
To: "Beginners" <[EMAIL PROTECTED]>
Sent: Tuesday, July 23, 2002 1:16 PM
Subject: Cut string between the words
>
>I was just wondering if there is anything similar in perl for unix
>commands pushd / popd ??
>I can't find such a thing. You (or someone else) could write one. It
>doesn't seem too difficult; it's just an array.
Good Idea!! might as well do that!!
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
hmmm..they are array functions...I guess I can use the cwd/push/pop to simulate the
pushd and popd, just was being lazy :) and wanted to know if a direct pushd popd kind
of function exists!!
>how about functions like push, pop, shift, unshift ?
> -Original Message-
> From: Shishir K
On Jul 23, Shishir K. Singh said:
>I was just wondering if there is anything similar in perl for unix
>commands pushd / popd ??
I can't find such a thing. You (or someone else) could write one. It
doesn't seem too difficult; it's just an array.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED]
how about functions like push, pop, shift, unshift ?
> -Original Message-
> From: Shishir K. Singh [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 2:15 PM
> To: [EMAIL PROTECTED]
> Subject: pushd and popd
>
>
> I was just wondering if there is anything similar in perl for
> u
> -Original Message-
> From: Bob Green [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 9:11 AM
> To: [EMAIL PROTECTED]
> Subject: system() error return codes
>
>
> I need to execute DOS level commands from perl and I must be
> able to test
> for success.
> I've found the syste
I figure that I can use substr() to cut up a string, but how do I make it
between words?
How do I measure a string to see if it is greater than 85 characters?
Basically, if the string is more than 85 characters, how do I break it at
the last full word?
David Gerler
Gerler Enterprises
PO BOX 16
I was just wondering if there is anything similar in perl for unix commands pushd /
popd ??
Thanks
Shishir
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
I need to execute DOS level commands from perl and I must be able to test
for success.
I've found the system() function and it seems to work except I'm having
problems getting the correct error return back.
To test the error return I've created this very simple code. In it I try
everything I kno
> Have you installed Net::SMTP, it comes as a part of libnet package.
> If you have installed it check that the install directory is a
> part of the @INC array.
>
How to check if a module is installed or not ?
Manya
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (
On Tuesday, July 23, 2002, at 09:45 , chris wrote:
> You are correct.
perchance, but I will accept that as
"oh, well that's worth ripping off and reusing"
as being more accurate...
> I will follow your advice.
may I recommend that you limit following my
advice to only the 'useful p
Does anyone have any experience with this module?
Basically I have a PHP page which is passing a username and password to a perl script
that does some preliminary checking...then I want to call cracklib to do the rest...
Does anyone have a good example of how to do this. Everything is working
You are correct. I will follow your advice. Maybe I am making things
more difficult for myself.
On Tue, 23 Jul 2002 07:26:28 -0700, [EMAIL PROTECTED] (Drieux) wrote:
>why pass in an uninitialized value??? that is
>scoped to pass out of existence
>
>also this blessed "object" gambit should
can they share variables using pipes?
I am new to this list and don't know a lot about perl, but I think you could use pipes
in perl.
Pritpal Dhaliwal
-Original Message-
From: David T-G [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, July 23, 2002 2:52 AM
To: perl beginners
Cc: May
Switch the $a and $b and now you go to descending sequence:
foreach my $MyId (sort {$b->[1] <=>$a->[1]} map{[$_,$usernum{$_}]} keys
%usernum) {
Wags ;)
-Original Message-
From: dan [mailto:[EMAIL PROTECTED]]
Sent: Monday, July 22, 2002 17:55
To: [EMAIL PROTECTED]
Subject: Re: sor
On Friday, July 19, 2002, at 05:09 , Peter Scott wrote:
[..]
>> hence why the 'OO' style is so popular with the
>>
>> my $thing = FOO::BAR->new(@arglist);
>>
>> my $this = $thing->get_this($with_that);
>>
>> and the only 'exported' "method" is the 'new'...
>
> Please don't confuse
> -Original Message-
> From: Timothy Johnson [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 11:41 AM
> To: 'Bob Showalter '; ''Merritt Krakowitzer' '; 'Beginners '
> Subject: RE: Comparing Arrays
>
>
>
> In the "quick and dirty" category, you can do something like this:
>
>
LOL yup. I knew someone would catch that. As Marvin would say, "Back to the
old drawing board."
-Original Message-
From: Jeff 'japhy' Pinyan
To: Timothy Johnson
Cc: 'Bob Showalter '; ''Merritt Krakowitzer' '; 'Beginners '
Sent: 7/23/02 8:48 AM
Subject: RE: Comparing Arrays
On Jul 23,
On Jul 23, Timothy Johnson said:
>In the "quick and dirty" category, you can do something like this:
Too dirty. It says ('a', 'a', 'b') and ('a', 'b', 'b') are the same.
--
Jeff "japhy" Pinyan [EMAIL PROTECTED] http://www.pobox.com/~japhy/
RPI Acacia brother #734 http://www.perlmo
On Mon, 2002-07-22 at 19:15, David T-G wrote:
> Desmond --
>
> ...and then Desmond Lee said...
> %
> ...
> % A sample from the file looks like this:
> %
> % while ( $row = $db->sql_fetchrow($result) );^M
> % $db->sql_freeresult($result);^M^M $total_threads =
> % count
In the "quick and dirty" category, you can do something like this:
(I'm trying to remember off the top of my head)
##
my $result = ArrayCmp(\@array1,\@array2);
#pass two array references
sub ArrayCmp{
my($ref1,$ref2) = @_;
my %tmp = ();
if(@{$ref
On Tuesday, July 23, 2002, at 12:14 , Mayank Ahuja wrote:
[..]
> Putting it graphically,
>
>
> A
> |
> |
> |---
> | |
> | B
> |(New Terminal)
> |[User sets a variable]
> |
> |
>(execution of the script continues
>
>
> $variable =~ s/\S\S\S\S$//;
Heehee.. just for fun, what about if
$variable = "123456\t8\t0" ? =)
Rgds,
Connie
>
>
> John
> --
> use Perl;
> program
> fulfillment
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>
--
To
What I am after:
changes to one forces changes to other but could not make work
What I ended up with that works:
@{$this->{"pkg_variable2"}} = @{$this->{"pkg_variable1"}}
Sample listing of my problem follows.
use PkgA;
$pkga = "PkgA";
my $this = new $pkga;
print @{$this->{"pkg_variable1"}}; # t
On Jul 23, John W. Krahn said:
>Rich Busse wrote:
>>
>> I want to replace the last "#" with a newline. I've come up with a few ideas
>
>$_ = reverse;
>s/#/\n/;
>$_ = reverse;
Here's a (potential) Perl 5.8.1 way of doing it, which is likely to be
faster than the sexeger (reversing approach above)
Rich Busse wrote:
>
> I have a string that looks like
>
> Operator Overview#PGM#Report about all configured
> operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper#
>
> I want to replace the last "#" with a newline. I've come up with a few ideas
> like
>
> substr ($_, rindex ($_, "#"), 1) = "\n"
On Monday, July 22, 2002, at 04:36 , chris wrote:
> Here is what I am doing
>
> use A;
> my $this = {};
> bless $this;
> my $result = $this->A::sub1 (my $args);
why pass in an uninitialized value??? that is
scoped to pass out of existence
also this blessed "object" gambit should
be in the
David Samuelsson wrote:
>
> This should be really simple, just use a regexp to remove
> the 4 last letters from a variable.
>
> $variable =~ /\S\S\S\S$/;
> print "$variable";
>
> but this doesnt remove the 4 last letters when i run it, i
> think i am just getting tired here and cant see why, wh
This may be a long shot, but I am trying to get Arthur Corliss's
CursesWidgets 1.992 module to work on a SCO box. Must apologize first, I
do not understand curses, no more than the average pig understands
French.
Server OS: SCO Open Server 5 (oxymoron, but we can't call it SCO
Abandoned Server 5,
I just found out that some sites have pirated books. I don't know if
this is so or not, I've been told this is possibly a pirated copy. Sams
still have it for sale, I think.
Apologies, Jim
Jim Agnew wrote:
>
> There's perl in 21 days... found it by using google.
>
> http://194.106.118.30/ft
Doh! I forgot about using $! All I need is
s/#$/\n/ ;
Thanks to Tor & Tanton for getting my brain in gear...
> -Original Message-
> From: Busse, Rich
> Sent: Tuesday, 23 July, 2002 09:00
> To: 'Perl Beginners'
> Subject: Replace last # with \n
>
> I have a string that l
if you want to use s/// you can say
s/(.*)#/$1\n/;
- Original Message -
From: "Busse, Rich" <[EMAIL PROTECTED]>
To: "Perl Beginners" <[EMAIL PROTECTED]>
Sent: Tuesday, July 23, 2002 9:00 AM
Subject: Replace last # with \n
> I have a string that looks like
>
> Operator Overview#PGM#Repor
<[EMAIL PROTECTED]> wrote:
> I have a string that looks like
>
> Operator Overview#PGM#Report about all configured
> operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper#
>
> I want to replace the last "#" with a newline. I've come up with a few ideas
> like
>
> substr ($_, rindex ($_, "#"), 1)
I have a string that looks like
Operator Overview#PGM#Report about all configured
operators#/opt/OV/bin/OpC/call_sqlplus.sh all_oper#
I want to replace the last "#" with a newline. I've come up with a few ideas
like
substr ($_, rindex ($_, "#"), 1) = "\n" ;
or
substr ($_, length ($_) - 1, 1) =
On Monday, July 22, 2002, at 02:38 , kent ho wrote:
> Thanks,
>
> Kent
I will admit that I pulled out my copy of the
O'Reilly "Sed and Awk" - which I would recommend
if you are going to be in that space long.
Alternatively, you might look into perl
open(IN, "$file") or "die unable to
> -Original Message-
> From: Merritt Krakowitzer [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 3:48 AM
> To: Beginners
> Subject: Comparing Arrays
>
>
> Hi
>
> I would like to know how to compare 2 arrays.
>
> I have 2 arrays and I would like to compare the contents of the
Bob, et al --
...and then Bob Showalter said...
%
% > -Original Message-
% > From: David T-G [mailto:[EMAIL PROTECTED]]
...
% > Whoops! No it won't -- .* is greedy!
% >
% > You need something more like
...
% > /(p1)[^(p2)]*(p2)/g ;
...
% This does not match on input data like:
%
%
> -Original Message-
> From: Mayank Ahuja [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 3:15 AM
> To: Perl
> Subject: Can IPC work?
>
>
> Hi All,
>
> Please go through the following scenario:
>
> A perl script has been invoked from shell A. Within the perl script, I
> open
$var =~ s/.{4}$//;
Rgds,
Connie
- Original Message -
From: "David Samuelsson (PAC)" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, July 23, 2002 8:00 PM
Subject: Remove 4 last letters
> This should be really simple, just use a regexp to remove the 4 last letters from a
>v
> -Original Message-
> From: nkuipers [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, July 23, 2002 2:13 AM
> To: [EMAIL PROTECTED]
> Subject: RE: How to make @array2 use values of @array1?
>
>
> What I am about to raise, I do so more out of wanting someone
> to educate me
> than disagreei
On Tue, 23 Jul 2002, David Samuelsson (PAC) wrote:
> This should be really simple, just use a regexp to remove the 4 last letters from a
>variable.
>
> $variable =~ /\S\S\S\S$/;
This just checks if your patter \S... matches with the
contents of $variable.
This should be $variable =~ s/\S\S\S\S
Dave,
I did it this way
$variable = substr($orig_variable,0,length($orig_variable)-2);
I actually only removed the last 2 characters but I don't see why you
could not put a 4 and remove last four..
I am sort of new at perl but I did get the above to work. I needed
to drop off 2 n
> -Original Message-
> From: David T-G [mailto:[EMAIL PROTECTED]]
> Sent: Monday, July 22, 2002 8:13 PM
> To: perl beginners
> Cc: David Newman
> Subject: Re: regexp matching across newlines
>
>
> David --
>
> ...and then David Newman said...
> %
> % > Yes, but your *. should be .* to
This should be really simple, just use a regexp to remove the 4 last letters from a
variable.
$variable =~ /\S\S\S\S$/;
print "$variable";
but this doesnt remove the 4 last letters when i run it, i think i am just getting
tired here and cant see why, what is the right way to do it? :)
//Dave
tal vez te sirva leer esto:
http://www.perl.com/pub/a/2001/06/13/recdecent.html
es un tutorial de Parse::RecDescent, y como ejemplo se implementa un
mini-lenguaje, y se sugieren algunas ideas acerca de que se le puede
agregar. con suerte y este ejemplo es suficiente como base de tu
proyecto.
su
Chris --
...and then chris said...
%
% I have two variables (@array1 and @array2). @array1 will be
% initialized with a list of values. Is it possible to declare @array2
% in such a way that it will reference @array1?
Do you want @array2 to be a *copy* of @array1 when this is all done, or
shoul
Mayank --
...and then Mayank Ahuja said...
%
% Hi All,
Hello!
%
% Please go through the following scenario:
[snip]
...
%
% Is there a way by which Shell A can come to know of the value of the
% variable set in B?
% I don't know anything about IPC...can it work in this scenario?
T
Merritt Krakowitzer wrote at Tue, 23 Jul 2002 09:48:13 +0200:
> I would like to know how to compare 2 arrays.
>
> I have 2 arrays and I would like to compare the contents of the data. It doesn't
>matter in which
> order the data is stored so long as its the same. So comparing the bellow should
Merritt Krakowitzer wrote:
>
> Hi
Hello,
> I would like to know how to compare 2 arrays.
perldoc -q array
Found in /usr/lib/perl5/5.6.0/pod/perlfaq4.pod
[snip]
How do I compute the difference of two arrays?
How do I compute the intersection of two arrays?
[snip]
How do
Dan wrote:
>
> ok.. that worked, now how about if i wanted it to go the other way.. from
> most to least?
my @sorted = sort { $usernum{$b} <=> $usernum{$a} } keys %usernum;
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [
<[EMAIL PROTECTED]> wrote:
> Hi
>
> I would like to know how to compare 2 arrays.
>
> I have 2 arrays and I would like to compare the contents of the data.
> It doesn't matter in which order the data is stored so long as its the same.
> So comparing the bellow should read true, but if they didn
Hi
I would like to know how to compare 2 arrays.
I have 2 arrays and I would like to compare the contents of the data.
It doesn't matter in which order the data is stored so long as its the same.
So comparing the bellow should read true, but if they didn't match it would
be false.
my @foo = qw(
Okay, know I tried it and it works perfectly!
Thanks!
On Mon, 22 Jul 2002 15:37:03 -0400
Bob Showalter <[EMAIL PROTECTED]> wrote:
> > -Original Message-
> > From: Konrad Foerstner [mailto:[EMAIL PROTECTED]]
> > Sent: Monday, July 22, 2002 2:19 PM
> > To: [EMAIL PROTECTED]
> > Subject
95 matches
Mail list logo