-Original Message-
From: Jayakumar Rajagopal [mailto:[EMAIL PROTECTED]
Sent: Wednesday, April 14, 2004 11:16 AM
To: Beginners Perl
Subject: "\s" eq "\b" ?
hi friends,
in regexp, I feel \s and \b behaves same.
can someone send me a contradiction ?
thanks,
Jay
-End Orig Message-
> i am trying to write a perl script to tidy up any lines in a file that
don't
> contain alphabetic characters or single instances of character. i've
noticed
> that the even lines are being skipped when read in eg 0,2,4,6 - the script
> is run on window - any ideas?
> while () {
This line reads
> I am running a perl script as below which is working perfectly and want to
> replace the hardcoded values with variables.
> (the script accepts space as the delimiter)
> @respon = $placesock->print("./test.pl \"7741266\" \"DEM EXPO\"
> \"255.255.255.255\" \n");
>
> and i am doing this
>
> @resp
> Hi,
>I need some help on regular expression...
> i have following in variable $total_count
>
> $total_count = "##I USBP 01 10:38:09(000)
> ETRACK_TOTAL_RECS : 100"
>
> Here in this ETRACK_TOTAL_RECS is fixed and common for
> all and rest is changing...
>
> like following
>
> $total_coun
Response at end of message...
-Original Message-
From: Rod [mailto:[EMAIL PROTECTED]
Sent: Wednesday, December 10, 2003 12:19 PM
To: '[EMAIL PROTECTED]'
Subject: Match the first 3 characters of 2 words?
What is the easiest way to test the first 3 characters of two words for
a match.
IE
> From: Eric Walker [mailto:[EMAIL PROTECTED]
> Sent: Friday, November 21, 2003 1:34 PM
> Subject: search
>
>
> I am trying to search a string for a "[]". I want to count the amount
> of "[]" in the string.
>
> Any IDeas
perldoc -q count
gives you:
How can I count the number of occurren
> From: Steve Massey [mailto:[EMAIL PROTECTED]
> Sent: 23 October 2003 11:33
>
> #! /usr/bin/perl -w
>
> $test = "BRIGHTON (Firm)";
>
>
> print "$test\n";
> $test =~ s/,*/,/;
> $test =~ s/,*$/,/g;
>
> print "$test\n";
It looks like the +/* issue has bee
> using the following code.. I am looking to match any text that has a date
in
> it ie 8-Nov, nut my code also matches 8-11b, which is not what I want
>
> #! /usr/bin/perl -w
>
> $test = "8-11b1";
> ##$test = "8-Nov1";
>
> if ( $test =~ /(\d{1,2})\-(\w{3})([\d\w]*)/) {
> $day = $1;
> Any one have or know of a function to convert ugly "NAME, USER" to "User
Name"?
timtowtdi:
$str = "User Name" if ($str eq "NAME, USER");
$str =~ s/^NAME, USER$/User Name/;
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
> Hi to [EMAIL PROTECTED] This is my first posting so please be gentle.
> I've followed the comparing two lists thread with interest. What I'd like
> to do is to compare 16 lists to see whether each of the entries in e.g.
> list 1 is present in one or more of the other 15. Each entry in the list
> Anyone have any ideas about this - is there a common mistake I might be
> making here?
>
> I am using a simple regex to extract a few pieces of every line of a 2000+
> line text file then spitting it back into a second text file. I can't
figure
> out why but the output file always includes every
> We have a fairly simple redirect script a url is entered, and even tho
there are
> directions to not enter the "http://www"; sometimes we get it or
"http://";...
> what is the simplest method to extract just the domain name if a
> "http://www.somedomain_name.com"; or "http://somedomain_name.com";
> (Forgive the excitement)
Not a problem. Congratulations.
> I just reversed the %n2m construct - the original builds a hash using map
> that lets you convert numbers to months, etc. (I probably found it here).
>
> In keeping with my feeling that with 'map' one can do almost anything (if
I
> kne
Go back and re-read John's message. Then look at your conditionals. They
are different. His work, yours don't.
Yours:
87 $back =~ /.*\(.*\) (.*?) .*/;
88
89 if ( $1 )
103 $line =~ /.* \(.*\) (.*?) .*/;
104
105
--- 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
> > The following works the same and may or may not be easier to
> > understand/maintain.
> > $tokenCount{$_} is automatically created with a value of 0 when first
> > called, and
> > then is incremented to 1, so you don't have to test or create it
yourself.
> >
> > my @tokens = split /:/;
> > f
> It sounds like you need a count hash. You might try something like:
>
> my @tokens = split /:/;
> foreach (@tokens) {
>if ($tokenCount{$_}) {
> $tokenCount{$_}++;
>} else {
> $tokenCount{$_} = 1;
>}
> }
The following works the same and may or may not be easier to
unders
> I have this subroutine and it does what I need ::
>
> print rmgtlt($var);
>
> sub rmgtlt {
> $_[0] =~ s/^\<|\>$|\n|\r|\s$//g;
> return $_[0];
> }
>
> Is there a way to so the substitution and return the result in one line?
>
> Like ::
>
> sub rmgtlt {
> return ??? $_[0] =~ s/^\<
> I'm just trying to get a general feeling here from the community.
>
> I have a script that I am getting ready to turn over in "production mode".
I
> am using 'use strict' of course, and during my coding and testing, have
> enable warnings.
>
> Now that the code is ready to "go production", shoul
> > I'm trying to write a script that reads a file line by line and if the
line
> > contains a space it puts quotation marks around it and writes it to
another
> > file. I mostly have this working except that in the case of the lines
that
> > contain the space it puts the quotation mark at the
You probably should have started a new thread for this discussion.
> I'm trying to write a script that reads a file line by line and if the
line
> contains a space it puts quotation marks around it and writes it to
another
> file. I mostly have this working except that in the case of the lines
th
[most of message cut for clarity, see original for context]
> Now, I have an internally developed function
> (the internal of which are hidden from me) which
> processes the email addresses. This takes as one
> of it's parameters an array of strings.
> So before I call the function I say:
> @AddrL
> Hi,
> I would like to remove elements from an array that are eq to string '0'
> The following does not work, can someone shed some light on the proper
> way to do this.
> Thanks!
> Dave G.
look at the grep function:
perldoc -f grep
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional
> This (perl -n -we 'print if /[\[\].]{2}/;' file) almost did the trick, but
> it was also picking up lines with many .. or many
flanked
> in between something. So I ammended it to (as there is always a space
> between the characters I am trying to pull out):
>
> perl -n -we 'p
>> I have another problem, I have a string of nicknames that looks like:
>>
>> $mystring1 = "nick1,nick2,nick3,nick4,nick5";
>>
>> I've asked this question before, but because of my bad regex
>> knowledge, I'm asking again, but this time in a slightly different
>> context. The last time I asked,
> Basic question on using '&&' vs 'and'. I see that '&&' has higher
precedence
> than 'and', but why does
>
> print 1 && 1 && 0;
> print "\n";
> print 1 and 1 and 0;
> print "\n";
>
> return
> 0
> 1
>
> I would have expected both statements to return 0.
>From a couple of experiments, I wou
> I have a MS Excel exported CSV text file, with , separated values. The
> problem now, is that some of the values also contains a , character, and
MS
> Excel thus put the values in a quote such as:
> "blah, blah", blah, "blah, blah, blah"
>
> How would I go about fixing this little issue?
T
> I am trying to extract ".jpg" (subtype of the file) from the string:
> c:\my_files\file.jpg
>
> I found the following pattern on the net:
> $file =~ s/.*[\/\\](.*)/$1/;
> which extracts the file name (file.jpg). I understood most of that pattern
> except what does the (.*) part does? And how ca
>I have a hash of arrays. Here is a sample of one of the elements
>
>$hoa{key}=[2,somestring,someotherstring];
>
>If I where to print it like this
> print "$#{hoa{key}}"
>It print 2.
I'm pretty sure this isn't your actual code.
>From how I understand this $# is dereferencing and should pr
Is this in pseudocode or in working code?
I would guess that it is some sort of meta- for tilde (~), since you
need =~ before the s/// construct.
/\/\ark
-Original Message-
From: lielie meimei [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003
>Should be a simple question. I am trying to only print the element of the
> hash, that matches the $user string but it prints all of the elements.
What
> am I missing.
print "$lookup{$user}\n";
> Thanks
>
> $user = "jsmith";
> my %lookup = (
> 'jsmith' => "jsmith1",
> 'djones'
LS> I have a script that is used for text messaging. I added a
LS> line of code to check to make sure that input is in a field
LS> before the message is sent. My code is as follows:
LS>
LS> if($b !~ m/^\w[\w\s]*\w$/) { $error .= "Enter a message \n"; }
LS>
LS> This fails if the field has any
>I have a script that is used for text messaging. I added a line of code to
>check to make sure that input is in a field before the message is sent. My
>code is as follows:
>
>if($b !~ m/^\w[\w\s]*\w$/) { $error .= "Enter a message \n"; }
>
>This fails if the field has any punctuation characters.
> Is there an easy way to get the location of a specific instance of a
> character in an array?
>
> for example:
>
>$MyArray = "This is the test";
>
> I would like to know the index of the first occurence of the letter "h"
( 1
perldoc -f index
index $MyArray,'h';
--
To unsubscribe, e-mail
> But what I really want to do is this :
>
> push( @MyArray[0], 2 );
> push( @MyArray[0], 3 );
>
> push( @MyArray[1], 4 );
> push( @MyArray[1], 5 );
> push( @MyArray[1], 6 );
I apologize. My first response was incorrect. You need:
push( @{$MyArray[0]}, 2 )
> I would like to know if it is possible to do somthing like this:
> ( I know I can't do it this way as Perl barfs when I tried it )
>
> $SizeOfMyArray = 2;
>
> $MyArray[ $SizeOfMyArray ];
Why are you trying to define the size of your array?
> push( @MyArray[ 0 ], 0 ); << --- complains
> I have tried to read a file in backwards in stead of from the top
> without any success !!!
http://search.cpan.org/author/URI/File-ReadBackwards-0.99/ReadBackwards.pm
/\/\ark
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAI
> What exactly would I enter if I want a program to find the epoch time for
> midnight each night? I know how to find "current" time and date in both
> "human" time and epoch time.
I can't give you code, because I haven't worked with perl's various time
functions, but logically, I would get the
-Original Message-
From: Jensen Kenneth B SrA AFPC/DPDMPQ
[mailto:[EMAIL PROTECTED]]
Sent: Thursday, January 09, 2003 10:59 AM
To: '[EMAIL PROTECTED]'
Subject: Reqxp help
Trying to make a one liner regxp to covert a file. File has lines like these
(lines are preceded with a space)
Dec
It helps to answer your question if you show us what you've already done,
and tell us what you know...
perldoc -f keys
perldoc -f sort
/\/\ark
-Original Message-
From: Rajendra Babu, Praveen
[mailto:[EMAIL PROTECTED]]
Sent: Monday, December 30, 2002 3:16 P
Is it always at the very end of the string?
If not, then are there any other numbers enclosed in parens in the course
names?
Probably the following should work:
$course =~ s/( \(\d+\)$//;
# removes a space followed by an '(' followed by 1 or more digits, followed
by ')' at the end of the string
F
> Hello. I have a logfile in which every message begins with a timestamp
(ex. - 20012091500). I would like to be able to remove the last 4 characters
(1500) off each of these to derive the date only (2001209). It works by
chopping of each character individually, but I would like to know if there
is
perldoc perlpod
-Original Message-
From: Matt Simonsen [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 11, 2002 3:33 PM
To: [EMAIL PROTECTED]
Subject: multi line comments
I believe there are no multi-line comments in Perl. Do any of you have a
good hack to fake these?
Thanks
Matt
> 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
>I tried to lookup the "perldoc -q" on the net but couldn't find anything?
>(www.perldoc.com right?)
perldoc is software that generally is installed with perl.
perldoc.com has the same information, but doesn't have a way to use the
flags that the software version has.
The -q flag to perldoc sear
First open the file using open:
perldoc -f open
Then use the filehandle (FILE for instance) to put the first line in $str:
$str = ;
Then if you don't want to do anything else with the file, close it:
perldoc -f close
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
S
The '-w' helps you debug your code by producing warnings. The code may
work, but $a has not been initialized when it reaches the if statement, so
it will always fail. Is that really 'perfect'? Why have the if block if
you know it will never be executed? The easy, although prone to overuse,
solu
perldoc -f push
-Original Message-
From: Jakob Kofoed [mailto:kof@;mail.dk]
Sent: Tuesday, October 22, 2002 2:30 PM
To: [EMAIL PROTECTED]
Subject: adding stuff to array
Hi,
Can you ad a value to an array?
fx:
@xx = aa bb cc
but I would like to put in "ss"
so my new array would look
I would guess that you are missing a curly bracket '}' somewhere in your
program, but the program doesn't realize it until the end. The only way to
find it that I know of is to use good spacing in your program and walk
through { by { looking to make sure that it's paired correctly.
See bottom for my response...
-Original Message-
From: dan [mailto:dan@;abovenet.org]
Sent: Monday, October 21, 2002 5:42 PM
To: [EMAIL PROTECTED]
Subject: Tables
ok, this probably has an easy answer, but yet i can't think of it. i want to
create a "table", not a table in html, otherwise
see bottom...
-Original Message-
From: P lerenard [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, October 09, 2002 1:21 PM
To: [EMAIL PROTECTED]
Subject: sort a hash
Hi,
@array = qx{egrep -n '\{' file);
foreach $el (@array)
{
($num,@other} = split(/\:/,$el);
$thenum{$num} = $num;
}
foreac
"Can someone help me please?"
Can you be more specific about what you don't understand?
If $foo is a string of alpha characters and you use ++ you get a string with
the last character incremented alphabetically.
This does not work both ways, -- does not reverse the effect of ++ on
strings.
This looks like homework, but I'll give you a (one of many, I'd guess)
pseudocode solution:
sub print_combos(str,list) { # note -- PSEUDOCODE
if (empty(list)) {
# if (str != "") # do you want the empty list as an output?
print str;
} else {
x = pop list; #remove an element
> This is from Chapter 9, page 281 slighly
>changed to reflect my values:
>
>for $table ( keys %tablename) {
>print "Table Name: $table \n";
>
>for $items ( keys %{ $tablename{$table} } ) {
>print "\t$items=$tablename{$table}{$items}\n ";
>
>}
>
>print "\n";
That looks re
-Original Question-
D-2165033-10.TKB61a => D 2165033 10
and
4-2175587-08.TKB63a => 4 2175587 08
using
(( $ref, $numt, $id, $ext ) = $PATH[ 7 ] ) =~
/\w-(\d{7})-(\d{2}).[\w+|\d+]/;
What am I doing wring?
-My Response-
Your parens are in the wrong place.
You aren't capt
>
> I am reading this file and have assigned the array[2] as $partition.
>
> sk5719::Is Automatic ARP supported on Linux
> platforms?::Public::03-JUL-01
> sk14508::The last date to order VPN-1/FireWall-1 CP2000 is December
> 31,2002.::Public::23-SEP-02
> skI4680::Which files to
If you are comparing numbers, you want to use == (strings use eq).
You probably also only want to have one set of parens:
if ($a == $b || $a == $c || $a == $d) {print "here"}
or you could clarify further:
if (($a == $b) || ($a == $c) || ($a == $d)) {print "here"}
You should put the following lin
Unless you are sure that the threads won't be running around midnight, you
should take the date into account as well.
/\/\ark
-Original Message-
From: Yacketta, Ronald [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 26, 2002 10:08 AM
To: '[EMAIL PROTECTED]'
S
see my comments at bottom...
-Original Message-
From: Shaun Bramley [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 24, 2002 4:39 PM
To: [EMAIL PROTECTED]
Subject: Regular Expression help
Hi all.
I am hoping that someone can help me determine what is wronf with my regualr
expressio
-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, September 10, 2002 12:32 AM
To: Beginners Perl Mailing List
Subject: Regular Expressions: Grouping and backreferences...
Hello, All:
How can I capture all the words that contain 'at' in the string 'A fa
I would point you to
perldoc -f exists
perldoc -f defined
and you will end up with either
if (exists $hashname{$variable})
if (defined $hashname{$variable})
depending on your definition of 'set'.
Notice the {} around the variable instead of [].
/\/\ark
-Original Message--
bottom posted...
-Original Message-
From: Jessica [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 20, 2002 9:23 AM
To: [EMAIL PROTECTED]
Subject: need help extracting words from a string
I am such a knuckle head... I read the lists. I stumble through books and
still I cant figure out
Do you want them in two separate variables, or in a list?
Are you looking for just this one case, or a more general case?
/\/\ark
-Original Message-
From: Jerry Preston [mailto:[EMAIL PROTECTED]]
Sent: Friday, August 16, 2002 1:19 PM
To: Beginners Perl
Su
perldoc perlrun
-Original Message-
From: Mario [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, August 13, 2002 5:09 PM
To: [EMAIL PROTECTED]
Subject: Perl from command line documentation
Hi all!
I'm triying to replace my awk habits with perl, but I wonder if there is any
place
where I can f
'deprecated' means that in the future, this functionality is expected to be
removed from the programming language.
It generally implies that you should do what you are doing in a different
way so that in the future your code will still work.
In this case, it looks like you are trying to assign th
How are you creating the report?
If you are using some sort of print statement, what does it look like?
Where is the data coming from?
The boxes are non-printing characters of some sort. If you know that you
are only going to use a small set of printable characters, you could
probably create a
Looks to me like you understand it better than I did. I don't understand
your question.
/\/\ark
-Original Message-
From: Joe Sprankle [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, July 31, 2002 10:44 AM
To: [EMAIL PROTECTED]
Subject: more regex woes...
Hi all,
I
-Original Message-
From: Steve [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 26, 2002 5:21 PM
To: Mark Anderson
Cc: Beginners@Perl. Org
Subject: Re: regex question
>From what I have read from The Camel $1 should contain the matched text.
>From that matched text I want to then
I'll try to answer one of your questions...
>I'm having some trouble trying to easily remove lines from a data file
using
>a regular expression. I can do it by reading the file in
>a line at a time then deciding whether to chuck it or write it out. My data
>looks something like this -
[Data remo
$1 is a special variable. What are you actually trying to do here?
What do you want to have print?
[I've copied you, but please respond to the list.]
/\/\ark
-Original Message-
From: Steve [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 26, 2002 4:20 PM
T
-Original Message-
From: Rupert Heesom [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 26, 2002 3:42 AM
To: [EMAIL PROTECTED]
Subject: How well does Perl support FTPing?
Hi:
[Does Perl support FTPing with resume?]
I'm involved in the development of an application which will have modules
-Original Message-
From: Eric Preece [mailto:[EMAIL PROTECTED]]
Sent: Friday, July 26, 2002 4:09 PM
To: [EMAIL PROTECTED]
Subject: A basic question about arrays
Hello,
Yet another newbie question. I have a file, each line is a pipe delimited
list (user name and password). I want to op
>I couldn't quite follow this program off the book. The parts not quite
>clear to me are (the hwole program is given below):
I'll go through them block by block, and then you can ask deeper questions
about the ones that I don't explain well enough.
>$i = 0;
I'm guessing that you know that $i i
>From: nkuipers [mailto:[EMAIL PROTECTED]]
>
>>Would trapping it an eval be what the doctor ordered?
>
>To answer my own question, no, it would not.
>
>#use warnings;
>
>would be better.
It would probably be best to use
no warnings;
before the sort line in your script and
use warnings;
on the f
== is a numerical operator
eq is a string operator
"something" == "notsomething" looks at the numerical value of each string,
and they are the same so it returns true.
"something" eq "notsomething" looks at the actual strings, which are
different and returns false.
for more information:
perldoc
> But, could someone explain the meaning of the "$" in the above expression,
> s/\s$// .
The $ looks for end of line/end of string. This is expression is saying
take the whitespace character followed by end of line and replace it with
nothing. If there is no whitespace character at the end of t
Do you have multiple lines coming to STDIN? If so, then your $idNumber is
probably getting blown away when the regex doesn't match later in the file.
If you only want the first line of the file, then remove the while.
If you have multiple lines that will match, you'll need a different
structure,
I came across a reference to lvalue(s) in
perldoc -f substr
I then searched perldoc for "lvalue", and looked at each reference in:
perldoc perldiag
perldoc perltoc
perldoc perlfunc
perldoc perlsub
perldoc perlop
perldoc perlguts
perldoc perlsyn
perldoc perlfaq7
perldo
Okay, with some experimenting, it looks like @lines is being looked at in a
scalar way, therefore as the number of elements in the array, and that
number doesn't contain the string "Date:".
I would suggest:
foreach(@lines) {
if(/Date:/) {
print "ok"
}
}
My apologies,
I miscopied the code, it should have been:
foreach (reverse sort keys %myhash) {
print "$_ : $myhash{$_}\n";
}
-Original Message-----
From: Mark Anderson [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 21, 2002 11:38 AM
To: [EMAIL PROTECTED]
Subject: RE: Re
More readable/maintainable is:
@items = qw(a b c d e f g h i j k l m n o p q r s t u v w x y z);
@sortedItems = reverse sort @items; #reverse sort the array
print "@sortedItems";
Which gives the following as the answer:
foreach reverse sort keys %myhash {
print "$_ : $myhash{$_}\n";
}
>>From: Bob Showalter
>> From: Postman Pat
>>
>> Greetings,
>> I am trying to do command line processing using the above
>> lib, but am not
>> quite getting the syntax from the PLEAC perl project. For
>> instance I have
>> the following args allowed:
>> -s x.x.x.x | server.domain.com > serv
>I'm trying to loop through a list of variables and print their values.
>e.g., print $name, $age, $phone.
>
>What's the best way to do this? I've tried
>
> foreach (qw(name age phone)) {
> print ${$_};
> }
>
>but that doesn't seem to work.
It works for me (using pe
It's a matter of memory management. If you suck in an entire file, you
could run out of memory, making your script run slower. Also, you have to
do all of the reading before you can start processing the file.
while () {
if (/something/) {
print "$_\n";
}
}
or
while (my $i=) {
If you just want to pass a limited number of parameters, in a specified
order, where they will always be there, it's easiest. They are then stored
in the array @ARGV.
script.pl filename.txt
has the string filename.txt in $ARGV[0]
If you want to use flags and optional parameters and such then r
This code will read the entire file into the array. This works fine for
SMALL files. When you get into large files, the program will take up more
RAM than the file takes on disk.
You also probably won't eliminate your loops. They may no longer be while
loops, but you will likely still need to
>Is File::Find a standard module? (It is a module, right?) I don't know
>anything really about modules except that they exist. Is this method
>better than using opendir/readdir/closedir?
>
>And back to the original question, is CPAN good for questions like this?
>What do people usually use it f
>>> No, you need ++ vs +1. As they say in perl, ++ is magical and will
>>> do want you want. + 1 will not.
>>>
>>> Wags ;) ps -- is not magical in the same sense as ++ either.
>>
>> How would you decrement a character then? There surely has to be a
>> way?
>
>perldoc -f ord
>perldoc -f chr
>
/\/\ark
-Original Message-
From: Allison Ogle [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 18, 2002 11:05 AM
To: Mark Anderson
Subject: RE: Incrementing the letters in an array
If you're suggesting trying
$code[$y]=$code[$y]++;
it brings me one step closer in that
Those are likely non-printable characters in whatever font you are using.
Use substr and ord to get the octal value and then split on it.
Double check to make sure they are all the same character.
/\/\ark
-Original Message-
From: Scott Lutz [mailto:[EMAI
perldoc -f split
Your split statement is attempting to split $_, not @data.
-Original Message-
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 17, 2002 6:54 PM
To: [EMAIL PROTECTED]
Subject: Perl simple array
Hey All,
Just wondering why the following code wo
You need to escape the $ in the regex:
$string =~ s/\$//;
-Original Message-
From: Daniel Falkenberg [mailto:[EMAIL PROTECTED]]
Sent: Monday, April 15, 2002 5:16 PM
To: [EMAIL PROTECTED]
Subject: Strip $ from variable
Hello All,
I was just wondering how I would go about stripping the $
No, you are printing to OUTFILE, which directs the output to "ex92.out".
/\/\ark
-Original Message-
From: Bruce Ambraal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 3:00 PM
To: [EMAIL PROTECTED]
Cc: [EMAIL PROTECTED]; [EMAIL PROTECTED]
Subject
The only thing that you are sending to STDOUT is a "\n" for each line of
your STDIN.
/\/\ark
Please don't cross-post.
-Original Message-
From: Bruce Ambraal [mailto:[EMAIL PROTECTED]]
Sent: Thursday, April 04, 2002 2:43 PM
To: [EMAIL PROTECTED]; [EMAIL PR
Hope this helps. I made a lot of changes, and I didn't comment them all.
I'm not sure where/how you sent this to the list, but I'm responding back to
the beginners list. Don't crosspost between lists if you can help it.
/\/\ark
# warnings and strict help you
on the same line, others
will be separated by a .
I want to be able to bring in each line into the correct part of the
HTML.
-Original Message-
From: Mark Anderson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, April 03, 2002 4:22 PM
To: Glenn Cannon; [EMAIL PROTECTED]
Subject: RE: Reading
Specific by line number? specific by text in the line? specific as
line-by-line? Please be more specific. :)
To read line $x of FILE into $line:
foreach 2..$x;
$line =
reads in the next line of the file.
Hope this helps,
/\/\ark
-Ori
First of all, you are only matching a single digit. You want to change your
regular expression from /(\d)/ to /(\d+)/, which matches one or more digits,
and slurps up as many as it finds in a row. One issue you will have is that
a file containing addresses, you are also going to get a count on a
I would suggest using something like the following, where INFILE is the
filehandle of your textfile:
my $NewLine = "";
my $TheLine = "";
#read in 500 characters from INFILE until INFILE is exhausted
while (read(INFILE,$NewLine,500)) {
# concat $NewLine to the end of the existing $TheLine
I'll help what I can. You need to store the input and not print it out
until after you've printed out your raport. I'm not sure what you are
doing, so I haven't tried to fix anything except the printing of the report.
If this code is going to be in use for a while, it would be good for you to
ad
1 - 100 of 114 matches
Mail list logo