nt crammed in a relatively small area in the
middle of the screen doesn't add anything.
Regards,
--
Offer Kaye
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/
my $array_object=Math::MatrixReal->new_from_cols($ref_AoA);
You can test the resulting object using:
print $array_object;
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
;$_ =>$name \n";
to:
my $name = gethostbyaddr(inet_aton($address), AF_INET);
if ($name) {
print OUTPUT "$_ =>$name \n";
} else {
warn "Can't resolve $address: $!\n";
}
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands,
_tran) = @_;
format_name OUT "NEWOUT";
format NEWOUT =
@<<<<<<<<<<<< @>>>>>>>>>>>>> @>>>>>>>>> @>>>>>>>>>>>>> @
{
# output table 1, with 3 columns
my($id,$num_occur,$msg) = @_;
format OUT =
@<<<<<<<<<<<<<< @>>>>>>>>>>> @<<<<<<<<<<<<<<<<<<<<<<<<<
$id,$num_occur, $msg
.
write OUT;
}
sub _print_format2 {
# output table 2, with 6 columns
my($clock,$skew,$num_ffs,$max_lat,$min_lat,$max_tran) = @_;
format NEWOUT =
@<<<<<<<<<<<< @>>>>>>>>>>>>> @>>>>>>>>> @>>>>>>>>>>>>> @>>>>>>>>>>>>>
@>>>>>>>>>>>>>>>
$clock, $skew, $num_ffs, $max_lat, $min_lat, $max_tran
.
write NEWOUT;
}
# The End!
Hope this helps,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
her/better solutions?
Thanks in advance,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
entence.
But why is "print" behaving differently? I.e., why is the 0x_
not treated as a number?
Thanks,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
> perl -e 'printf "%d\n" ,0x8000_'
-2147483648
> perl -e 'print 0x8000_ , "\n"'
2147483648
> perl -e 'print 0x8000_ - 0x1 , "\n"'
2147483647
> perl -e 'printf "%d\n" ,0x8000_ - 0x1'
214748
3...
> but that is still using the
> assumption that there *must* be at least one space character delimiting
> columns.
1. There *must* be at least one space character between columns.
2. Data is guaranteed not to include a whitespace.
Regards,
--
Offer Kaye
--
To unsubscribe, e
On 8/14/05, Manav Mathur wrote:
>
> How do you logically determine that "l2dat4" in line 2 is column 4 and not
> column 2??
>
> Manav
>
Because as a human, I can see they are aligned.
I guess a program will have to count whitespace, but then there is the
issue of l
tten, I have no control over that...
Regards,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
s for the app
installation - deb, rpm or whatever you use.
If you would like to write a Makefile.PL for each of the modules
distributed with your app so that the modules are installed inside the
standard Perl modules installation directories, I suggest reading:
http://search.cpan.org/dist/ExtUtils-
nt to use depends on what your array looks like and
what you want to do. In any case you don't need to "repopulate" the
array - both pop and shift change the array itself. Finally, note that
"splice" can 'emulate' both operators - see the "splice" per
you aren't a member/friend, you need to register in order to vote.
What are you waiting for? ;-)
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
n advance.
>
http://perldoc.perl.org/perlintro.html
http://perltraining.com.au/notes.html
Search Google, many universities have course notes for beginner level
Perl courses.
Regards,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL
On 6/6/05, Chris Devers wrote:
>
> Or -- shock horror -- get a gmail / hotmail / yahoo / etc account
Why *horror*? Gmail rocks :)
Email me if you want an invitation.
Cheers,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
On 6/7/05, Offer Kaye wrote:
> Hi all,
> I have a POD file with the following link:
> L
> podchecker complained about this ("node '$/' contains non-escaped | or
> /"), so I looked at "perlpod" and read that I should use "E"
> instead
d to escape metachars in the replacement part. Without
modifiers (such as "e" or "x") the replacement part is treated as a
simple double-quoted string (delimiter dependent).
So the s/// can be written as:
s|\./officers-gasenate\.html|http://www.legis.state.ga.us/cgi-bin
On 6/7/05, Cy Kurtz wrote:
> Is it possible to use s/foo/bar in another way to allow replacement of
> large blocks of text with spaces, quotes, and double quotes?
>
Yes.
> Is there a better way?
>
That depends on what exactly you want to do.
HTH,
--
Offer Kaye
--
To unsu
ings?
Is this a known Pod::Html bug?
Or perhaps a bug in the browsers I used?
What can I do to solve this issue (without having to dig into the
Pod::Html internals :))?
TIA,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
r "hidden" files.
>
> undef $/;
Why?
>
> return if($_ =~ /^\./);
...
> if ( m/$query/i ) {
Why use 2 forms for matching $_? Try to be consistent, it really helps
readability...
> stat $File::Find::name;
>
Again, why? Especially as you are calling stat in empt
perldoc.perl.org/functions/chomp.html). As an experiment, try
doing:
while (defined(my $line = )) {
local $/ = "\r\n";
chomp $line;
# rest of code...
}
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
t; and "D")
Maybe it's your Perl version. What is the output of "perl -V"?
Try reading "perldoc perlebcdic"
http://perldoc.perl.org/perlebcdic.html
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
all these is happening only in EBCIDIC platform. in ASCII it is fine.
>
As I don't have access to an EBCIDIC platform, I can't check this.
However this should work:
use strict;
use warnings;
my $bb = "\xa0\xa0\xa0\x{100}" =~ /(\xa0+)/;
print "Valid\n" if ($1 eq "\xa0\xa0\xa0");
print "$bb $1\n";
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
ng script using Devel::ebug
and could not quite reproduce this issue. I'm using the latest
Devel::ebug version (0.43). Has anyone had any success using this
module for debugging work?
Cheers,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTE
tab=wd
http://www.google.co.il/advanced_search?hl=iw
http://www.google.co.il/preferences?hl=iw
http://www.google.co.il/language_tools?hl=iw
http://www.google.co.il/intl/iw/about.html
http://www.google.com/ncr
Died at aaa.pl line 10.
### end output
(the die statement is on line 10).
So
as an RE, only the first part:
s/PATTERN/REPLACEMENT/
PATTERN is a regexp.
REPLACEMENT is treated as double-quoted text (delimiter dependent)
unless you use the "e" modifier, in which case REPLACEMENT will be
eval'ed as a Perl expression.
HTH,
--
Offer Kaye
--
To unsubscribe, e-ma
cter), so you
would have to show us some code that fails with the above pattern.
Off-hand I can't think of any reason why "C\#" would match while "C#"
would not.
Regards,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL P
vacation message on
> their account?
I second that. Especially with regards to "anti-spam" messages. Those
are pure spam on a moderated mailing list.
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
a Perl tool, I recommend "HTML Tidy":
http://tidy.sourceforge.net/
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
::Basename :
use Cwd qw(abs_path);
use File::Basename qw(dirname);
my $path = dirname(abs_path($0));
However please note that the current process may be running in an
entirely different directory then the one that hold the executable. To
find the current directory, use:
use Cwd qw(cwd);
my $
quot;upgrade" might
cause you to have 2 versions of certain files, but for most cases a
simple:
cpan> install Module::Name
should work.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
t;my"
instead of "our". Don't use globals without a good reason, it's a bad
habit :-)
Cheers,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Oops- replied to wrong list :) Please ignore...
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
Perl debugger to help you pin-point the
problem. Write a test-case with minimal code and data that shows the
problem, and post that to this list. Then maybe someone can help :)
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<h
m;
my @bar = map {$sum+=1+length} split(/e/,$foo);
print join(":", @bar[0..$#bar-1]) . "\n";
It is however a bit forced. I would stick to the "while" - much more readable :)
Cheers,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
email you wrote:
"and get_something() change the hash"
That's a no-no according to "perldoc -f each": "If you add or delete
elements of a hash while you're iterating over it, you may get entries
skipped or duplicated, so don't."
Cheers,
--
Offer Kaye
--
T
ded... I am thinking that somehow maybe the perl
> compiler/interpreter is
> doing some optimzation that is different when the "size" of your perl program
> is at a different
> size
>
No. Never. At least, not AFAIK. Maybe one of the list gurus can say otherwise.
Cheers,
CTED]);
Just before you pass @data to GD::Graph::Boxplot. You should see which
values are undefined, although perhaps that will not help you to
understand why they are not defined.
You might also want to try out the Devel::ebug module, it's very nice :)
http://search.cpan.org/dist/Devel-ebug/
H
nter
> accessible from inside the loop? I was unable to find anything related in
> perlvar.
>
Neither was I, but I suspect the reason is that if you need a counter,
you should not be using "foreach". Instead, use "for":
for(my $counter = 0; $counter < @array; ++$co
, explain exactly what you were expecting
and what the problem is, and *then* we can help.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
quot; instead of "printf". Read "perldoc
-f printf" and "perldoc -f sprintf" from your command-line, or online:
http://perldoc.perl.org/functions/printf.html
http://perldoc.perl.org/functions/sprintf.html
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTEC
mplating
solution, can be used for any problem where a template is needed.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
get a "Local user "[EMAIL PROTECTED]" unknown on host "zzz""
message... it only accepts messages to or from a local user."
Maybe your server doesn't like '[EMAIL PROTECTED]' as a from
field? More likely, 'user' is not a valid email - try
y for? Surely all you need is a host, username and password?
>
If indeed you are using a login method (username and password), then
replace "NTLM" with LOGIN. So instead of:
>auth => 'NTLM',
Use:
>auth => 'LOGIN',
HTH,
--
Offer Kaye
--
To u
rl.org/perlfaq5.html#How-do-I-do-a-tail--f-in-perl-
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
ually looping over
your data. In that case I suggest you start looking at XML modules
that provide OO access methods to your data, such as XML::SimpleObject
:
http://search.cpan.org/dist/XML-SimpleObject/SimpleObject.pm
That's just a suggestion, there are of course many others out there :-)
e.
1. You should move the seek inside the "if".
2. Even after fix (1), your program will be stuck in an infinite loop,
since every time it will reach the last line it will jump right back
to the first line. Use a flag, condition or other mechanism to make
sure you loop through the file o
ttp://perldoc.perl.org/perldata.html (everything about Perl data types)
http://perldoc.perl.org/perlintro.html (Perl Introduction - a great
beginner resource)
You can also read these from your command-line using the "perldoc"
command. Try "perldoc perl".
HTH,
--
Offer Kaye
--
To
the output of running "perl -V" from the command line. Also please
paste the exact contents of test.pl.
Regards,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
for details:
http://perldoc.perl.org/perlsyn.html (about the "while" flow control keyword)
http://perldoc.perl.org/functions/defined.html (about the "defined" function)
http://perldoc.perl.org/perlop.html#I-O-Operators (about the
"" construct)
* Line 15 - this time we w
d code
Read the documentation of File::Find for more details about using this
module. You can read from your locally installed Perl documentation
(i.e. "perldoc File::Find from the command line), or online at:
http://perldoc.perl.org/File/Find.html
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
ork. Here's a
correct version:
my $address = '[EMAIL PROTECTED]';
my ($domain) = $address =~ m/\@(.+)/;
And one more, using s/// instead of m// :
my $address = '[EMAIL PROTECTED]';
(my $domain = $address) =~ s/^.+?\@//;
--
Offer Kaye
--
To unsubscribe, e-ma
($/);
>
> ,I have no idea how it undefs $/. Points to a good reading on the
> subject are equally appreciated.
>
It declares $/ to be local without giving an init value. So now $/ has
the value of "undef". This isn't specific to $/ - local will do the
same to any va
change the PATH
for the rest of the script (and any sub-processes launched by it).
Someone else will have to help you if you want to change the system's
PATH, I don't know how to do that. Perhaps you should clarify what you
meant.
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROT
On 27 Apr 2005 11:34:21 -, laxmi goudappa patil wrote:
> Hello..
> Im new to the Perl..
Post some code, no one will be able to help you otherwise.
Also, "Hello" is a bad subject for an email to this list. Please use a
more meaningful subject in the future.
--
Offer Kaye
-
gth" for an explanation of the length function.
Some example code:
## begin code
use strict;
use warnings;
while () {
chomp(my $orig = $_);
s/-(-+)/"-".("x"x length$1)/ge;
print "$orig > $_";
}
__DATA__
bla
- Ram
-- bla
bla ---
-- blah ---
## end code
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
these lines in it:
>
> -o-b- - - -f
> F01045
Meaningless question subject, obscure question, some strange code and
data thrown in - it's like you don't *want* to get an answer ;-)
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EM
way, Depending on your needs, you can use "%s" as
the printf format string, or use simply print:
begin code
use strict;
use warnings;
use Math::BigInt;
my $num = Math::BigInt->new("12345678901234567890");
print "Orig string: 12345678901234567890\n";
p
On 4/26/05, N. Ganesh Babu wrote:
> Dear Offer Kaye,
>
> I want to preserve the tag also in the context. Can you help me how to
> do it. If you run 2nd time also the same action will happen. If we remove,
> in the 2nd execution again the conversion will take place on these
;. Anyway, you can use Math::BigInt to handle large
integers.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/26/05, Manish Sapariya wrote:
> [EMAIL PROTECTED] gdb /usr/bin/perl core.24670
> GNU gdb Red Hat Linux (5.2.1-4)
Read "perldoc perlbug"
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://lea
if any of the gurus on the list could shorten:
my @un;
$line=~s!(.+?)!push @un,$1;""!ige;
To a single line. Unlike "m//", "s///" never seems to return the
results of "()" in the RE, even in list context. Annoying :-(
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/25/05, Robert Kerry wrote:
> What should I do? Thank you.
>
You should use Google :-)
The first link returned by searching for "Tomcat" and "Perl":
http://www.ftponline.com/javapro/2003_03/online/perl_teden_03_18_03/
HTH,
--
Offer Kaye
--
To unsubscribe, e-m
s, you are better off using the Automake
and Autoconf tools from the GNU Foundation:
http://www.gnu.org/software/automake/
http://www.gnu.org/software/autoconf/
Automake itself is written in Perl.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-m
ldoc.perl.org/Getopt/Long.html
The documentation is very clear, you should be able to whip up a
working example very quickly.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/21/05, Paul Kraus wrote:
> Why would one use Require instead of Use?
>
Because you want the action at run-time (require) vs. compile time
(use), is the usual reason, I would guess.
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail:
'o',
't',
'h',
'r',
'e',
'e'
];
As you can see, your version doesn't work correctly.
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
e_foo.pl contents
$VERSION is an example of a variable in Foo.pm accessible from an
external script, and munge() is an example of such a function.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/21/05, FreeFall wrote:
> > 3. But there's an even easier way, without having to use map:
> > my @record = split /\s*\|\s*/,$date;
>
> -->this seems it cant delete spaces of the last element.
>
Have you tried it?
--
Offer Kaye
--
To unsubscribe,
because they can shift for year to year. Do you know of a resource I can
> look at?
>
I know of:
http://www.sadinoff.com/hebcal/
http://search.cpan.org/dist/Date-Holidays/
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
&
;7"
7'10" x 16'
83' X 40"
17' x 50'
5' X 90'6"
39" X 100"
30" x 12'
28-3/8" x 14'4"
16' 6-3/4" x 43"
21'3 1/2" x 24'
14'8.5" x 16'7"
# end code
If anything in the code isn't clear, please don't hesitate to ask.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
ow
constitutes the return value.
3. But there's an even easier way, without having to use map:
my @record = split /\s*\|\s*/,$date;
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/20/05, Olivier, Wim W wrote:
> Hi all,
>
> Is it possible to use GetOpt::Long (or something similar) in a subroutine
Getargs::Long -
http://search.cpan.org/dist/Getargs-Long/
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mai
> bemused Angie
>
Metachars in the results perhaps? Have you tried dumping @tables using
Data::Dumper and looking at the results?
Try using quotemeta (http://perldoc.perl.org/functions/quotemeta.html):
my $table = quotemeta;
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED
rint $array[-$_] . "\n";
}
# end code
It is much faster because it doesn't read the entire file into memory,
or go over all of it just to get to the last 10 lines. Just be careful
- Tie::File lets you also modify the file, if you want. Read:
http://perldoc.perl.org/Tie/Fil
ogle search box the following string:
search_term site:perldoc.perl.org -filetype:pdf
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
se fails, you might consider using tied hashes. Read:
http://perldoc.perl.org/functions/tie.html
and
http://perldoc.perl.org/Tie/Hash.html
[1] http://search.cpan.org/dist/Devel-Size/
[2] http://search.cpan.org/dist/Devel-Monitor/
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
File::Path, that can be used
to create a directory tree:
http://perldoc.perl.org/File/Path.html
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/19/05, lio lop wrote:
> I need to print the text between two words
> that are in different
> lines.
>
print "\n";
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http
r my $program (@progs) {
my $tee = new IO::Tee(\*STDOUT,
new IO::File(">$program.log"));
print $tee `$program`;
}
# end code
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
On 4/18/05, Jay Savage wrote:
>
> $line =~ /(\S+)/\u\L$1/g ;
>
Almost right - returns "Level A (grade 1 Reading Level)" - notice the
lowercase "g" in "grade"). Should be:
$line =~ s/(\w+)/\u$1/g;
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PRO
t;;
for (split /(\s+)/,$line )
{
$ucline .= ucfirst($_);
}
print "$ucline\n";
## end code
Of course this means the ucfirst function will also operate on
whitespace, but this doesn't do any harm.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
bottom is:
begin quote
* print "# Perl header `$_' does not appear to be properly
installed.\n";
Correct by running h2ph over your system's C header files. If
necessary, edit the resulting *.ph files to eliminate perl syntax
errors.
###
anks in advance.
>
Google "active directory perl" (without the double quotes), you'll
find lots of good resources, e.g.:
http://www.rallenhome.com/books/adcookbook/code.html
http://isg.ee.ethz.ch/tools/realmen/det/adsi.en.html
http://www.perl.com/pub/a/2001/12/19/xmlrpc.html
HTH,
>
> So is there a better way to do it?
>
Why not use method #2 and use the @cases array for the actual case
statements? E.g.:
case ($cases[0]) {
...
}
Note- the parens around $cases[0] are not optional, since this method
uses a variable as the first argument to "case".
HTH,
On 4/14/05, David Gilden wrote:
> use strict;
Where is "use warnings;" ? It seems to be missing ;-)
> use switch;
Shouldn't that be "use Switch;" (with a capital "S")?
Read "perldoc Switch", the usage syntax is well documented there.
--
Offe
On 4/13/05, Jay Savage wrote:
> Hi, all:
>
> Below is a script to extract jpegs from an image of a corrupted or
> accidentally erased CF or other removable media from a digital camera.
Here's another one, found by Googling. Maybe it will help:
http://www.zinkwazi.com/tools/jpg-r
take everything from one
$magic to the next, if you assume multiple jpegs in one file, instead
of looking for the EOI (since you can't find it)? Each such block will
then be, I assume, a (possibly corrupt) jpeg.
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional comm
through the RT system.
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
rid of empty last and first elements:
shift @checks; pop @checks;
print(OUTPUT "Cheque Debits @checks\n");
print(OUTPUT "Current Balance: ");
for (@checks)
{
$balance -= $_;
print(OUTPUT "$balance ");
}
print(OUTPUT "\n");
end code
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
general, conversion from a string to a number is transparent in
Perl. "4" is the same as 4.
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
rg/perlboot.html#A-few-notes-about--ISA
Then read this:
http://perldoc.perl.org/perlobj.html#A-Class-is-Simply-a-Package
HTH,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
d the "s"
modifier to make "." match a newline.
> 2. It breaks it up into parts, $1,$2,$3,$4, etc. Can I save the
> parts into an array ?
Simply assign the result of the match to an array:
my @arr = /(\/\S*).+?\((\d+)/sg;
--
Offer Kaye
--
To unsubscribe, e-mail: [EM
so, we
> could use that to see what Perl does with those two different
> assignments above.
>
Seeing is one thing; understanding - that's quite another thing ;-)
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http:/
ariable $list1.
What were you trying to do?
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
to do with it. This
behaviour is due to "die". From "perldoc -f die":
If the last element of LIST does not end in a newline,
the current script line number and
input line number (if any) are also printed, and a
newline is supplied.
Hope this helps,,
-
ist != 1 must be wanted lines.
$pricelist[1] is the second element of the array @pricelist. If you
need to know more, read "perldoc perlintro", it is a very good
introduction to Perl's syntax, variables, etc. The reason the number
we want is in the second and not first element h
7;
a b c d
$ perl -le' @) = qw/ a b c d /; print for "@)"'
@)
Now all is well :-)
But now I'm confused - if you knew of the above rule, why take me to
task for not escaping the '@' sign in my code?
Regards,
--
Offer Kaye
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
1 while $str =~ s/(?<=@)(.+?)_/$1./;
Go ahead and try it - I promise you it works.
I don't know where this is documented*, so I can't prove this, but at
least as far as the code, it works. So do my solutions, BTW - I tried
them before posting.
* If you or anyone else knows where thi
1 - 100 of 141 matches
Mail list logo