Mark-Nathaniel Weisman wrote:
> I've got a script that reads a mail file, then copies it into an array.
> The same script then pulls the data out of the array into another file
> location. I've got a situation here, in that when I do the print
> OUTFILE "@array"; it adds a singular space in front
[EMAIL PROTECTED] wrote:
> Hi
>
> filenameRnott230602.txt
>
> I want to break down the name and compare with other text, it breaks down
> as R / nott / 230602 (3 items)
> the length does not change.
If this is an equality compare, why don't you concatenate the other texts and compare
the res
"Shishir K. Singh" wrote:
> >on Sun, 30 Jun 2002 12:08:23 GMT, Dan Fish wrote:
>
> > What is the most efficient (or at least AN efficient :-) way of
> > obtaining a slice from an array wherein the slice contains only
> > unique values found in the array?
>
> >See
> > perldoc -q duplicate
>
Langa Kentane wrote:
> Greetings,
> I wish to use the fork() function on one of my scripts. I would like more
> clarity on the way it works.
>
> Take for instance the ff code:
>
> Sub mysub
> {
> while ()
> If ($_ eq "SCANME")
> {
> fork()
After the fork c
tom poe wrote:
> Hi: I really appreciate the input on separating $header and $body from those
> on the list so far. The suggested modules all seem too complicated to me, so
> I continue to read Chapter One, over and over. In the meantime, I think I
> have something close to what I want to acco
David vd Geer Inhuur tbv IPlib wrote:
> Hello,
>
> Last time I got so much feedback that I will try it again. I learned a lot of
> the last recommendations, but the next issue could not be made more efficient by
> me. Can you ?
>
> #!/usr/local/bin/perl
> #
> my $base = "/user/IPlib/IPlib/Analog_
Thanks for that
Jenda Krynicky wrote:
> Then how come
>
> $x = 'Hello';
> sub foo {
> $_[0] = 'Hi';
> }
> foo($x);
> print $x,"\n";
>
> prints
> Hi
> ?
>
> The parameters are passed by reference, though in little strange way.
> If f
Elias Assmann wrote:
> On Tue, 11 Jun 2002, Jeff 'japhy' Pinyan wrote:
>
> > modifies the ACTUAL argument you passed to rcsname()? Only if you had
> > done
> >
> > sub rcsname {
> > $_[0] =~ s/foo/bar/;
> > }
> > or some other specific effort would you have modified the argument to the
>
Tara Calishain wrote:
> three mice
>
> While some of the lines have semicolons:
>
> three;mice
>
> For the semicolon'd lines, I need to remove the semicolons and
> surround them with %22, like so:
>
> %22three mice%22
Loop through all the lines (assuming the line is in $str) and ad this line
$s
David vd Geer Inhuur tbv IPlib wrote:
> Hi Sudarsan,
>
> Sorry forgot to mention that :
>
> $pwuser = ($ENV{'REMOTE_USER'}); ## Apache var
>
> $groupfile is the group-file apache uses to authenticate. Unfortunetly there is
> no such thing as :
>
> $group = ($ENV{'REMOTE_GROUP'});
>
> The
David vd Geer Inhuur tbv IPlib wrote:
> Hi,
>
> I am currently almost done with my current job.
> As I am reviewing my scripts the foreach-loop started to anoy me.
>
> I am afraid this is slowing down the script. Does anyone know a faster way to
> do the following :
>
> # --
> open(FH, "< $gr
> while (){
> if(S/\>//){
'>' does not have to be escaped (this is not an error, it is the capitalized s as you
mentioned)
You can just write this as s/>//.
$_ = a>a>a>a>';
s/>//g;
print "$_\n";
This prints
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
>
>
> #!/usr/bin/perl -w
>
> system("/usr/bin/clear");
> @arg1 = qw(
> mail
> sysquota
> root
> nobody
> smmsp
> daemon
> testing
> );
When you are doing does it exist operation a hash would be a better data structure
than an array.
>
>
> unless (open(
>
>
> You are assuming that your string if it ends with a number will only be 4 digits
>wide.
> if $str is assigned "hello fred 12345" it will print nothing.
>
$str should actually be $ff, sorry
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
> Hi All
> The code I have written below works, and yes I could leave it at that.. but
> I want if possible to write efficient
> code as this seems to be what PERL is all about. So any thoughts anyone ??
>
> =
> this cod
patrick hall wrote:
> Hi,
>
> I'd like to push all sequences of capitalized words
> onto an array.
>
> So, given this paragraph (which I just snagged off AP)
>
> Indian Prime Minister Atal Bihari Vajpayee said
> Wednesday that India would consider jointly monitoring
> the disputed Kashmir border
Zachary Buckholz wrote:
> Is there any function to tell if a number is even or odd?
> I am looking for an easy way to loop through a list and
> output table cell bgcolor based on even / odd.
>
> if its an even numbered row make it red if its odd make
> it blue.
$_ % 2 ? print "blue\n" : print "r
>
>
> ($bash, ($rest)) = split(/\s/, $line);
$rest will still only contain 'FRI'. This is the same as
my ($a) = (1, 2, 3, 4);
$a becomes 1 after this 2, 3, 4 are just ignored
>
>
> to force the slurp and then dump it into a string. Try 'em both; neither
> is tested.
>
--
To unsubscribe, e
[EMAIL PROTECTED] wrote:
> hi guys,
> I would like to split a line like that
>
> # FRI MAY 02
>
> in two parts:
>
> $bash = #
> $rest = FRI MAY
>
> in my version ($bash, $rest) = split(/\s/, $line);
Change this line to
($bash, $rest) = split (/\s/, $line, 2);
perldoc -f split
>
>
>
[EMAIL PROTECTED] wrote:
> Hi,
>
> I'm having a very frustrating time with a small test program I'm trying to
> write. I'm using ActivePerl 5. I'm sure the answer is simple and I'll kick
> myself when someone clarifies the matter, but here goes anyway:
>
> The error message is:
>
> "Undefined sub
drieux wrote:
> On Friday, May 31, 2002, at 02:13 , Sudarsan Raghavan wrote:
>
> > while () {
> > chomp;
> > s/^\s+//;
> > next if ((1 .. /^NPROC/) || m/^$/);
> ># The conditions have been swapped here
> ># Expla
"Mok T.Y.-r15382" wrote:
> While executing an example Tk code from the book, the following message prompts:
>
> "Can't locate Tk/FBox.pm in @INC (@INC contains: d:\perl\lib\site d:\perl\lib
>c:\perl\lib c:\perl\lib\site c:\perl\lib\site .) at regexE
> valuater1.0.2.pl line 111, chunk 1."
>
> Pr
"CATHY GEAR (TRUST HQ)" wrote:
> Yes please post the final working solution! This is always helpful.
>
> Thanks
>
> Cathy
>
The best solution was John's offer
while () {
if ((/NPROC/ .. /^Total/) && /\d/) {
my ($user, $mem, $cpu) = (split)[1, 4, 6];
print
Postman Pat wrote:
> I am trying to create a small database with the information like this:
>
> Each record has a name ie :
> Dog
> And has the following traits:
> color
> weight
> nick
>
> For example I could have the following data:
>
> Name: dog
> Color: green
> Weight:
> < ...
> so I fear his (1../^NPROC/) isn't doing quite what he was hoping that
> it would be doing >>
>
> yes, i noticed that, but was easily fixed with minor adjustments
I failed to notice this mail, was the adjustment what I had mentioned about
swapping the conditions in the if statement.
Sudarsan Raghavan wrote:
> Original Message
> Subject: Re: Help with parsing output
> Date: Fri, 31 May 2002 11:07:16 +0530
> From: Sudarsan Raghavan <[EMAIL PROTECTED]>
> Organization: HP ISO
> To: "John W. Krahn" <[EMAIL PROTECTED]>
>
Original Message
Subject: Re: Help with parsing output
Date: Fri, 31 May 2002 11:07:16 +0530
From: Sudarsan Raghavan <[EMAIL PROTECTED]>
Organization: HP ISO
To: "John W. Krahn" <[EMAIL PROTECTED]>
References: <[EMAIL PROTECTED]>
<[EMAIL PROTECT
"Kipp, James" wrote:
> >
> > # INPUTDATA is the filehandle through which you are getting the input
> > while () {
> > chomp;
> > s/^\s+//;
> > next if (m/^$/ || (1 .. /^NPROC/));
>
> >what does the range thing do?
> >wouldn't just ... || /^NPROC/ be enough?
>
> I think that is how h
"Kipp, James" wrote:
> I am reading output from a pipe to a command called 'prstat' (like top).
> just wanted to get some ideas on the best way to capture the data i am
> looking for. below is an example of the output:
# INPUTDATA is the filehandle through which you are getting the input
while (
"Shishir K. Singh" wrote:
> don't think there is a way to get the full path. The only way I can think of is by
>concatening the results of the readdir with the $path that you used for opening the
>directory.
perldoc -f glob
print while (<$your_src_dir/*>);
This will print all the files with $y
"Jonathan E. Paton" wrote:
> > > Greetings,
> > > How would I go about shredding a file with perl, for instance, I have a
> > > script opening a time file, writing something in there and then deleting
> > > the temp file when execution is done. How would I go about securely
> > > deleting the tem
can download from www.activestate.com
>
>
> Apologies for sounding so dim, but, will either of these machines have perl
> installed ?
>
> If I don't have perl, can I download it from the web? - if so, where from ?
>
> Many thanks..
>
> Jonathan
>
> -Original Message
Sudarsan Raghavan wrote:
> Anders Holm wrote:
>
> > Hi folks!
> >
> > Of relevance her would be what OS you are on as well.
> >
> > Windows
> > Solaris
> > Linux
> > Mac
> > Other?
> >
> > Why? Because different OS's
TAWN Jonathan wrote:
> Hi..
>
> What are these "perdoc perl and perldoc perltoc "?? - I have NO idea !!
perldoc is a utility that comes along with the standard perl distribution
similar to man on unix (man perl and man perltoc would also work)
type perldoc perl on the command line and see what h
Anders Holm wrote:
> Hi folks!
>
> Of relevance her would be what OS you are on as well.
>
> Windows
> Solaris
> Linux
> Mac
> Other?
>
> Why? Because different OS's treat this differently. Anyone here ever tried
> to get back a deleted file on a Unix box? Not a very fun prospect.
I am not sure
"Langa F. Kentane" wrote:
> Greetings,
> How would I go about shredding a file with perl, for instance, I have a
> script opening a time file, writing something in there and then deleting
> the
> temp file when execution is done. How would I go about securely deleting
> the
> temp file afterwards
Gary Stainburn wrote:
> Hi all,
>
> I added a chomp giving -
>
> find . -type f|perl -ne 'chomp ; unlink||die "$_ : $!\n"'
You could avoid the pipes and try this instead
perl -MFile::Find -e 'find (sub {unlink|| die "$File::Find::name : $!\n" if (-f)},
".")'
>
>
> and it worked.
>
> Gary
>
>
Felix Geerinckx wrote:
> on Mon, 27 May 2002 13:01:36 GMT, [EMAIL PROTECTED] (Harry
> Jackson) wrote:
>
> > s/\s+$//g;
>
> As explained by Sudarsan Raghavan, the 'g' modifier is not necessary.
> The '+' in '\s+' gobbles up all trai
David vd Geer Inhuur tbv IPlib wrote:
> Hi,
>
> I know how to delete 1 or more whitespaces at in a line using :
>
> while {
> s/\s+//g;
> }
> close IN;
>
> #-
>
> But How do I specific delete 1 or more whitespaces at the end of the line ?
> using :
>
> while {
>
Sudarsan Raghavan wrote:
> >
> > >
> > > I need to do something, but being new to Perl I'm not sure it's possible
> > or how to do it. I need to remove lines of information from a text file
> > based on information in another file. The first fil
>
> >
> > I need to do something, but being new to Perl I'm not sure it's possible
> or how to do it. I need to remove lines of information from a text file
> based on information in another file. The first file contains information
> about some business transactions, each line describing one tra
Jorge Goncalvez wrote:
> Hi, i have this:
> open INFILE, "< $_Globals{SYSLOG}" or die $!;
> #ModifiedFile();
> while () {
> if (/([0-9a-z:]+)\s*via eth0)/) {
> $_Globals{MAC_ADDR} = $1;
>}
> }
> And my file is like this:
> .
> LOG_INFO :
[EMAIL PROTECTED] wrote:
> Hi
>
> Does any one know how to ftp a file using a perl script? are there modules
> etc that can be used?
perldoc Net::FTP
>
>
> Thanks
>
> Stephen Redding
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
> Hi all,
>
> I have the following data stored in a variable ($str_line), but I only need the
>usernames (ie the first column) from this information. How do i extract just the
>user names?
>
> aragonm 172.24.142.136 aupoza528 (v1.1), start Thu 23/5 13:54
>
Slavtek wrote:
> Hello,
> I want to copy some files from one place to another. Maybe someone tell me how can I
>do this using Perl?
> Thanks in advance!
perldoc File::Copy
Loop through the files in your source directory (using glob or opendir and readdir)
and copy them.
perldoc -f glob
perldoc
Sudarsan Raghavan wrote:
> Bryan R Harris wrote:
>
> > I have a large directory tree that I'd like to build index files for,
> > essentially an
> >
> > ls > index.txt
> >
> > in each directory in the tree. Obviously I'm having
Bryan R Harris wrote:
> I have a large directory tree that I'd like to build index files for,
> essentially an
>
> ls > index.txt
>
> in each directory in the tree. Obviously I'm having trouble figuring it
> out. =)
>
> I've tried the following:
>
> use File::Find;
> sub process_file {
> i
[EMAIL PROTECTED] wrote:
> Hi All
>
> I have a textfile comprised of x number races each with x number of runners
> eg.
>
> 13:00
> runner1
> runner2
> runner3
> runner4
>
> 14:00
> runner1
> runner2
> runner3
>
> 15:00
> runner1
> runner2
>
> I want to put each race time into seperate array and
>
>
> #!/usr/bin/perl -w
> use strict;
>
> my $var=1;
>
> sub thisSub {
> local( $var );
>
This will give this error "Can't localize lexical variable ..."
A working example
#!/usr/bin/perl -w
use strict;
$main::var=1;
sub print_var { print "packa
http://perl.plover.com/FAQs/Namespaces.html
Postman Pat wrote:
> Greetings,
> I read in the book SAMS Teach Yourself Perl in 21 Days that you can use
> my/local to declare vars. They explanation I got from the book did not do
> much explaining on exactly what the difference is between the two.
[EMAIL PROTECTED] wrote:
> Hi there,
>
> I would like to transfer an array-reference from sub "get_link_attr_entry_list"
> to sub "get_link_priority", but it doesn't work.
> Here is the code:
>
> use strict;
>
> my $link_id = '';
> my $link_attr_entry_list_ref = '';
>
>
> get_link_attr_entry
Could try this too
perl -p -i.bak -e '/^ftp/ ? undef $_ : s/\bguest\b/ftp/gi' /etc/passwd
the -i.bak will also create a /etc/passwd.bak for you
Timothy Johnson wrote:
>
> Actually it's a good question, and I should have explained myself. When you
> do this line on a file, it slurps up the ent
Marc M Dawson wrote:
> I am supposed to parse a text file such as this-
> 781457 Hartanto Victor Setiawan <[EMAIL PROTECTED]>
> 777557 Hatfield Benjamin <[EMAIL PROTECTED]>
> 779777 Henry James <[EMAIL PROTECTED]>
> 777947 Hergert Michael William <[EMAIL PROTECTED]>
> 778097 Iverson Jennifer
jc wrote:
> Hello,
>
> I inherited a project where we use a procmail filter to filter emails as
> they come to our web server and pipe them through a perl script. The
> script called "filterme" goes through the email line by line and grabs
> information on the email, puts it into an array, and w
>
>
> I'm just new to Perl and have no idea where to start with the task that I have to
>complete. Any help would be appreciated.
>
> Currently when a particular .exe is run, the following is displayed in the command
>window -
>
> License server on host "kronos".
> Running since Monday 4/04/96
Take a look at
perldoc -f open
perldoc -f split
[EMAIL PROTECTED] wrote:
> I had been assigned a work of extracting data from a text file.The text
> file has these datas
> 193.9.200.123,prashant , ,y,22/04/02,12:09:43, , ,
> ,http://rediffmail.com.
> I have to fetch IP address,uesr name
Scott Lutz wrote:
> What is the purpose of the following code?
>
> @list = keys %{{map{$_,1} @list}};
map {$_, 1} @list > $_ is holds the value of the current element of @list
i.e. being processed
for e.g. if @list contains ("abc", "def", "ghi"), a list like ("abc", 1, "def",
1, "ghi", 1) is
A Taylor wrote:
> Hi all,
> I am trying to read all the files in a certain directory. I can open a
> directory using:
>
> opendir(DIR, $some_dir) || die "can't opendir $some_dir: $!";
while (my $file = readdir (DIR)) {
#Do your stuff, readdir returns only the filenames
#you will have to pr
[EMAIL PROTECTED] wrote:
> Hello everybody,
> my code below should read in data from a file info.txt into a hash, the sub
> print_hash should print all hash-elements. actually it only prints the last
> key-value-pair. Does anybody see the mistake?Thank you for your help!!!
>
The scripts runs
>
>
> 405^100^200^A^B C D E
>
> while () {
> $number_of_elements= 0;
> chop;
> ($record, $customer, $location, $plan, @items) = split(/\^/, $_);
> $number_of_elements= $#items + 1;
> print "number_of_elements: $number_of_elements\n";
> }
>
> At th
Dave K wrote:
> Here is one script I used to inspect files
>
> use strict;
> my $fn;
> print"Enter the name of a file you want to examine ";
> while (<>) {
It is better to write this as while (). The reason being if all
the command
line arguments (if any are provided) have not been shifted
Hi All,
The following code gives the pid of the process holding the lock as 0
when run
with perl 5.6.1 on Redhat linux 7.2. It works fine with perl 5.6.0 on
the same
machine. The code that locks the file works fine (tested by getting the
lock
information with C code and using 5.6.0 perl). Has any
[EMAIL PROTECTED] wrote:
> Hi,
>
> What's the preferred waying of doing things...
>
> if ($var eq '')
>
> or
>
> if (defined $var)
>
> I assume they both mean pretty much the same thing?
>
No, defined is used to tell if the value is undef or not.
undef is a special scalar value, it is tr
Arvind Baldeo wrote:
> Hi All,
>
> Can some one please look at my code ad see what I am doing wrong.
>
> For some reason it is not working. The idea is to search the file using the
> commandline argument. It is supposed to read the file and if a match is
> found, it outputs to another file. If a
Rosa malliber wrote:
> Halo all,
>
> i want install perl at windows 2000, so what can i do ?
> some body help me, step by step installation perl at windows 2000
http://www.activestate.com/Products/Download/Get.plex?id=ActivePerl&a=e
>
> Please.
>
> Tx's
>
> Best Regard's
> Rosa
>
> __
Michael Gargiullo wrote:
> I have a bit of code thats throwing errors. "Use of uninitialized value..."
>
>
> #!/usr/bin/perl -w
> my $setup=0;
> while ($ARGV[0] =~ /^\-/) {
> if ($ARGV[0] eq '-s') {
>$setup = 1;
> shift;
The shift here removes $ARGV[0] from
Schelstraete Bart wrote:
> (sorry, my previous message was signed, which can give some problems)
>
> Hello,
>
> Can somebody tell me if it's possible:
> a) to count all the files in a directory , with extension 'msg' with perl
Check out the glob operator of perl (perldoc -f glob or perldoc
F
followed by 'd', not followed either 's' or 'k' or 'i' or 'p',
0 or more characters except newline, literal '.'
and finally fea. Is this what you want to match. Can you provide
some example strings.
>
>
> this does not match as
Mandar Rahurkar wrote:
> Hi,
> Its me again..
>
> 169b2_vow_band_1.fea
> 2168d6_vow_band_1.fea
>
> @files = grep /^.{3}g[^1].*\.fea$/, @files;
>
> can i have an or like for eg :
> @files = grep /^.{3|4}g[^1].*\.fea$/, @files;
>
You can write it as /^.{3,4}g(?!1).*\.fea$/
.{3,4} matches
On Tue, 2 Apr 2002, John W. Krahn wrote:
>
> > Sudarsan Raghavan wrote:
> > >
> > > Mandar Rahurkar wrote:
> > >
> > > > thanks to everyone for replying however I think i failed to define the
> > > > problem accurately :
> >
Sudarsan Raghavan wrote:
> Mandar Rahurkar wrote:
>
> > Hi,
> > thanks to everyone for replying however I think i failed to define the
> > problem accurately :
> >
> > i have files assigned to @files variable :
> >
> > 2168a5_vow_band_1.fea
&g
lier suggestion
holds.
>
>
> ls ???[^g][^1] *.fea
>
> Many Thanksplease do send in ur replies.
>
> Mandar
>
> On Wed, 3 Apr 2002, Sudarsan Raghavan wrote:
> 2168a5_vow_band_1.fea
> > > 169b2_vow_band_1.fea
> > > 2168d6_vow_band_1.fea
> &g
Mandar Rahurkar wrote:
> Hi,
> I need to select particular files from list that looks like this :
>
> 2168a5_vow_band_1.fea
> 169b2_vow_band_1.fea
> 2168d6_vow_band_1.fea
> 169g3_vow_band_1.fea
> neutral.txt
>
> This is how the list if files look like.I need files with only g for
> eg
> I can d
Ron wrote:
> For the life of me, I cannot remember how to find the certain numbers in a
> string. I remember how to find the length of an array but I cannot find how
> to find the length of a string in a variable.
perldoc -f length
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For
"Jonathan E. Paton" wrote:
> > > @data = (10,45,2,439);
> > > ($min,$max) = (sort {$a <=> $b} @data)[0,$#data];
> >
> > IMHO sorting a list to find the max and min
> > element is not a good idea. The sort is of
> > O(nlgn) and the usual run through the list
> > to find the max element is O(n).
Robert Graham wrote:
> Hi Ozgur
>
> You can use the following:
>
> @data = (10,45,2,439);
> ($min,$max) = (sort {$a <=> $b} @data)[0,$#data];
IMHO sorting a list to find the max and min element is not a good idea.
The sort is of O(nlgn) and the usual
run through the list to find the max
Take a look at Net::Telnet on cpan
subbu wrote:
> hi to all..
> can we use perl expect module to telnet to a specified
> machine and to execute a specified command on a
> remote machine..?
>
> regards
> keshav
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMA
Timothy Johnson wrote:
>
> Out of curiosity, what happens if you leave off the parentheses on $btwn?
Putting a parantheses on $btwn assigns $1 to $btwn. The statement can be broken
into two statements as
if ($str =~ /In:(.*)Your/) {
$btwn = $1;
}
>
>
> -Original Message---
Charles Lu wrote:
> Hi
>
>I am trying to think of a quick and simple way to find out if a number
> appears only in consecutive fashion once. In other words, a function that
> will return true if a particular number in a list appears only consecutively
> once.
>
> For example: Does "2" appea
> Thanks for the help!! Unfortunetly this solution only copies the modified
> line to the tmp file. I need the all the other data to stay unchanged.
> e.g. John:111:0
> Peter:222:0
> Jane:333:0
>
> becomes
>
> John:111:0
> Peter:222:1
Patrick Bateman wrote:
> Hi everyone
>
> Need help with this please, pretty please!!
>
> I open a file containing this:
> e.g.
> John:111:0
> Peter:222:0
> Jane:333:0
>
> Now I select a particular name from an input.
> Now comes the part I'm having trouble with. For that name I've
Frank 'Olorin' Rizzi wrote:
>Hello everybody.
>
>I am just starting with Perl,
>so the following question will probably appear simple to most of you.
>
>I am trying to get a Perl program to provide me with a listing of the files
>stored on the machine (where the program runs).
>The environment is
Bill Akins wrote:
> Hi all,
>
> After processing files in my perl script, I need to move them to the final
> destination. My problem is if the file already exists (lets call it
> data.txt), I need to rename it to data-v01.txt (where -v01 is version 01).
>
> So... if there are four other esisting
Tushar Kulkarni wrote:
> Hi,
> I have this code, but I am not getting how this works. Can someone
> help?
>
> %h = ( one => 15,
> two => 26,
> three => 37 );
>
> my @a;
Not sure what purpose this declaration serves. The 'a' referred to from here on in
the code is the has
Stuart Clark wrote:
> Hi all,
> Can anyone help please?
>
> # example values
> $Charge = "55";
> $CreditCard = "423452345654532";
>
>
> $VisaCard = /^4\d{15}/;
> $BankCard = /^(6565\d{12})|(555[10]00\d{10})/;
The regular expressions will try to match the contents of $_ here. From your
previ
[EMAIL PROTECTED] wrote:
> Hi
>
> I wish to do string comparisons where the case is ignored, for example:
>
> $one = "ExanPle";
> $two = ""example";
>
> if ($one eq $two){
> THIS RETURNS TRUE
if (lc($one) eq lc($two)) { #perldoc -f lc
HTH,
Sudarsan
>
>
> What do I add s
Michael Pratt wrote:
> This is what I want to do and I dont know where to start:
>
> List files in a directory taking that list with just the filename and no
> other information
Use the glob operator of perl (perldoc -f glob)
while (<*>) {
print "$_\n";
}
This should
Morgan,
You will have to refer the manpages for these functions
1) split (perldoc -f split)
2) open (perldoc -f open)
3) chomp (perldoc -f chomp)
The way to do this would be
1) Read in every line of the text file and chomp of the newline
2) Split the line such that you end up an array like this
COLLINEAU Franck FTRD/DMI/TAM wrote:
>
>
> I've found. I have to put the absolute path.
> Is there a way without absolute path ?
>
Use the glob operator (perldoc -f glob)
while ($rep = <$chemin/*>) {
# Do your stuff here #
}
HTH,
Sudarsan
>
> Franck
>
> -Mess
Gary Hawkins wrote:
> > Read through 'preprocess' subsection of the File::Find docs
> > (perldoc File::Find).
> > This might be of help to you.
>
> I already read the fantastic manual and was hoping for something that conveys
> understanding.
>
> "preprocess"
>The value should
Gary Hawkins wrote:
> Here's a fairly simple little script to list directories and files recursively.
> Couple questions:
>
> -- Is it fairly simple to make it list everything in a properly indented
> heirarchy? (Somewhat similar to what windows explorer would look like if every
> level were exp
zentara wrote:
> On Fri, 11 Jan 2002 04:39:05 -0800, [EMAIL PROTECTED] (John W. Krahn) wrote:
>
> >Zentara wrote:
> >
> >> I've been playing with File::Basename and
> >> the docs are not absolutely clear on whether
> >> you can get an extension on a linux system.
> >> I have had no success trying
"McCollum, Frank" wrote:
> I am not getting the Find Function. (FILE::FIND). I have found all of
> these great examples on the web describing how to use the find function
> under the following two conditions...
>
> 1) You know the exact File Name you are looking for, or you just want a
> list
are looking for
hth,
Sudarsan
Sudarsan Raghavan wrote:
> Use index (preldoc -f index).
> index ($str_from_file, $search_string);
> This will return a -1 if $search_string is not present in $str_from_file.
>
> hth,
> Sudarsan
>
--
To unsubscribe, e-mail: [EMAIL PROTECTED
Use index (preldoc -f index).
index ($str_from_file, $search_string);
This will return a -1 if $search_string is not present in $str_from_file.
hth,
Sudarsan
> How can I read a line from a file, and judge whether
> this line include some substr?
> Now I only can open(HANDLE," then how should I d
The find routine of File::Find traverses a file tree (recurses through the
subdirectories as well). Try out the following
piece of code
use strict;
use File::Find;
find (sub {print "$File::Find::name\n";}, $yourdirname);
This should print all the files and subdirectories within $yourdirname to t
Nestor Florez wrote:
> Hi there,
>
> I am trying to read a file and find the last numeric value in the line read.
> example:
> 123 45 -23 56 <-3.45
> 145 555 112 -12.0 -2.55
>
> all of the values are separated by a space and I am looking for the last
> value.
> I tried
If you know that the valu
Use splice (perldoc -f splice)
To delete array index $i
splice (@myList, $i, 1)
hth,
Sudarsan
Sharat Hegde wrote:
> Hello,
>
> I need to delete an element from a list (array). The delete function does
> not seem to work. For example if I need to delete element number "i" from
> the list "myList
Perl modules and functions that will be useful for this are
File::Find (type perldoc File::Find at the command prompt)
substr (perldoc -f substr)
rindex (perldoc -f rindex)
rename (perldoc -f rename)
After you have read through these docs you will be able to figure out
the perl script yourself.
h
You can use perl's glob operator (type perldoc -f glob at the command
prompt for help)
Wrap your script, except the exit(0) by
while (<$some_dir_name/*.txt>) { # Assuming you are searching for .txt
files.
}
hth,
Sudarsan
pn wrote:
> Hello,
>
> My question: I would like to be able to have
1 - 100 of 113 matches
Mail list logo