);
read FILE, $var, $size, 0;
You can leave off OFFSET if it's zero. Less confusing IMO, since the default
case for all places I've used read uses an offset of zero.
print $var;
Unnecessary double quotes around $var.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own
, rather than giving them such
funny names.
That's what Perl has data structures for, to save people using $formfield1
through $formfield15.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part
at least part of the
document with a GET request and figure it out from the contents.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate
@myarray, $ref;
}
Symbolic references are ick. Avoid. They often indicate a problem in your
design.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate
Lee Goddard wrote:
From: Philip Newton [mailto:[EMAIL PROTECTED]]
Rubinow, Larry wrote:
Finally, a legitimate case for symbolic references?
I doubt it. Having names like this for subroutines sounds
strange enough; they're not very descriptive.
Did you really want the full name
Lee Goddard wrote:
From: Philip Newton [mailto:[EMAIL PROTECTED]]
Symbolic references are ick. Avoid. They often indicate a
problem in your design.
Not my design - Sean Burke's MIDI::* packages, specifically
MIDI::Simple::synch.
I don't see where MIDI::Simple::synch requires symbolic
of whether SSI calls
Perl, C, or Bourne shell. The browser would have to fetch the document again
to get any changes.
If not, any suggestions.
Thanks in advance.
You might be able to do it in JavaScript: Load up a JS array and page
through that array ten links at a time.
Cheers,
Philip
--
Philip
not
what you want.
Are you running with -w and 'use strict'? If not, why not?
Thanks for any input.
HTH. HAND.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate
, on Unix, you could catch SIGTERM, SIGSEGV, and/or SIGBUS. Not
sure which signals are sent by the operating system on Win32; I believe only
SIGINT is emulated.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're
= join '-', ($string =~ /(...)(..)()/)
Which one of those is best is up to you. The unpack looks nicest to me in
this example.
Hope this helps.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part
$Bill Luebkert wrote:
You could use substr or a pattern match or ??. substr is
probably faster than RE.
And unpack possibly clearer.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part
= 0;
foreach $item ( whatever() ) {
print $item;
$i++;
print \n if $i % 2 == 0;
}
Or something like that. Can easily be adapted to after every third, eighth,
nth item by changing the modulus.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own
= q(Isn't this a nice $one!);
...
print eval $two;
Or you could use a function call instead of a string:
my $one;
sub what's_one_now {
return Isn't this a nice $one
}
...
print what's_one_now;
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All
the command returned. (You'll probably still have to
divide by 256, just like with the return value from system.)
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate
device) or based on the current time and process ID, among other things.
I'd say that's pretty good without trying to come up with a decent srand()
seed yourself.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're
to its arguments, so if it were a hash, you'd see a
hash in list context -- which is a list of (key, value) pairs.
As Joe Discenza said, you need to dereference the reference (in this case,
with %{ ... }).
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's
Mike Nolen wrote:
Any way to have Perl read Unicode?
I've heard good things about Unicode::String. The format you want to convert
from sounds like UTF-16; the format you want to convert to is perhaps latin1
(which is very similar to the Windows "Western" codepage).
Cheers,
Philip
feedback?
People do it all the time to have a script return an image. For example,
quite a lot of adserver code does this; try looking for something like
img
src="http://www.example.com/adserver.pl?site=daveswebsitex=480y=60id=48fb
29a"
-- where the image tag references not a static i
bably faster to check for *one*
non-space character than to see whether there are *only* space characters in
the line.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution,
and declare a charset of
UTF-8 or UTF-7, with an appropriate Content-Transfer-Encoding (probably 7bit
for UTF-7 and base64 for UTF-8).
Then encode your message contatining chr(8220) in UTF-7 or UTF-8.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're
'}.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com
to win32 it's a problem
if (-f "tele.conf")
{
eval `cat tele.conf`;
do 'tele.conf';
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the p
});
And in any case, how come print ($ref)-{eggs}, "aa\n";
doesn't print out the "aa\n" at the end, just the hex
hash value?
Because the arguments to print are only $ref. The return value of print is
subscripted with {eggs}, and then "aaaaa\n" i
est.pl, Perl has
already seen the "use vars" declaration for $x.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
___
Perl-Win32-
etely gone, nor is its value clobbered. It's only
invisible through the name $x until the end of the current block of file.)
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the p
er.
If you're interested, you could get in touch with Honza Pazdziora. I think
his address is: [EMAIL PROTECTED] (at least, it used to be). He
also presented a short paper on this at yapc::Europe 19100 in London.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my
h a couple of additional suggestions.
Please grep the FAQ or try `perldoc -q keyword` on a few keywords that come
to mind before asking. :-)
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the p
Onward wrote:
does anyone know where i can get a dbd::mysql binary install module?
I got mine from ActiveState: `ppm install DBD-Mysql` I think was what did
it.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution
also knows about `command` and 'text with spaces'.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
___
Perl-Win32-Users mailing list
[EMAIL
at http://Jenda.McCann.cz/#G .
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http
tories are separated
with '/'.)
From `perldoc File::Find`:
`$File::Find::dir' contains the current directory name, and `$_' the
current filename within that directory. `$File::Find::name' contains the
complete pathname to the file.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinion
alized
# value in print" under -w
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
___
Perl-Win32-U
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you're not part of the solution, you're part of the precipitate.
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl
alues? Then you should say so.
print '@File = ' , "@File\n";
This will print out the members of @File, separated by spaces (or the value
of $"). This may or may not be what you want.
Cheers,
Philip
--
Philip Newton [EMAIL PROTECTED]
All opinions are my own, not my employer's.
If you'
Aldo Calpini wrote:
Joe Schell wrote:
'Proper' being as defined in all of the relevant RFC's - presumably
including email comments and the older formats?
If so then you might wish to create a module. I don't believe one
currently exists that correctly checks the format.
it does.
$Bill Luebkert wrote:
Niklas Strömbeck wrote:
I'm really fresh in programming. I'm reading a number from
a file using a for-loop. Everything works except that I
can't compare the value of the loop ($chh) with the read
value ($hh) in the following if-loop.
chomp the read number to
John Giordano wrote:
$grep_deferred = system ('findstr DeferredStatus response1');
print "$grep_deferred\n\n";
[snip]
$grep_deferred has this in it:
a href="/c9410ee04de9845704db8951dfde015b/DeferredStatus"img
src="/images/btnstats.gif" width=120 height=40 border=0 alt="Mail
Status"/a
Purcell, Scott wrote:
How does one get the version of a installed package?
EG. If I want to know which version of the DBI I have, what do I do?
This often works:
perl -MMy::Module -e "print $My::Module::VERSION"
, since, by convention, modules contain a variable $VERSION containing the
William A. Jones wrote:
There are some unfortunate people (why did they enroll on
this list anyway!?!) who are using AOL 6.0 -- which has a
problem (among many): there is no option to compose
text-only email.
Eep. That's completely and utterly broken. For example, it makes it
impossibly to
Carl Jolley wrote:
On Fri, 26 Jan 2001, White, Velmond wrote:
I am trying to execute another script from within a script using the
"system" function as follows:
system("name.pl");
The name.pl does not execute. Both the calling script and
the called script are located in the
Cornish, Merrill wrote:
In list context, m//g returns a list of all matches. You
could count the elements in the list.
For example, like this:
$count = () = $string =~ /foo/g;
The assignment to () (empty list) puts the match in list context, and the
scalar assignment then counts how
Dietmar Maurer wrote:
From http://news.perl.com
I think that should be http://news.perl.org/ instead.
Cheers,
Philip
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-users
Robert Davis wrote:
I am using win32:SetCwd and it sets the current working
directory for the life of the perl program.
So should chdir(), which is built into Perl.
How do I make that change permanent so that once I exit the
directory is changed?
perldoc -q "changed directory"
The real
e batch file and sees
the new CD command and executes it.
Very, very ugly. I do not recommend this kind of thing. But it should work
(if (2) above is true -- it used to be but I don't know whether it still
is).
Cheers,
Philip
bob
Philip Newton wrote:
Robert Davis wrote:
I am using win3
Doug Brewer wrote:
where can i find a module/script/whatever that will encode URLs?
so that "my directory" becomes "my%20directory"??
URI::Escape . I believe this is part of LWP -- you may have to 'ppm install
libwww-perl' rather than 'install URI-Escape'.
Cheers,
Philip
$Bill Luebkert wrote:
Doug Brewer wrote:
where can i find a module/script/whatever that will encode URLs?
so that "my directory" becomes "my%20directory"??
URI::Escape or just code it (from URI::Escape docs):
$string =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;
He wants it the other
Nick wrote:
I am creating graphs as PNGs using GD, all works fine and the
graphs look great inthe browser but when printed the colours are
wrong eg green background with red lines instead of white
background with black lines. Could be something I've missed
but I am scratching my head and
Carlo wrote:
I am compressing an archive using
use Archive::Zip ;
use Archive::Zip::Tree;
and it works but let say that i do not want to compress files
with extention *.exe.
so if I am adding a directory
$zip1-addTree(
How can I exclude the files *.exe from the compression.
Alloun, Jonathan wrote:
Is there a module out there that will compare two dates??
Probably. There's tons of Date modules out there. Maybe Date::Calc or
Date::Manip.
For example: (date format is dd mm )
I have one date in a file: 10 12 2000
and another passed into the script which I
Jonathan, why do you seem to send all you messages with "Importance: high"
and "X-Priority: 1"? Do you think you're special or all your messages are
more urgent than other people's? Crying "wolf" like this gets old after a
while.
Alloun, Jonathan wrote:
I need to call a PERL script from within
john z wrote:
what are the preferred methods for controlling output to a
printer with perl. for example, if you wanted to print a
string 'hello' at a position of 1.5 inches down and 2 inches
right, what could you do.
Read your printer's manual and output the correct escape sequences to the
Carl Jolley wrote:
To print one element per line, here is one method:
print join("\n",@foo),"\n";
Here's another:
print join("\n", @foo, '');
The latter form may also come in handy if you're building up a string, since
you can't say
$output = join("\n",@foo), "\n";
(Well, you
Flynn, Timothy J wrote:
Is there another smtp-command that I should be using to
protect against this action, should I filter the ":", or
should I use a different mail sending module.
You should terminate the header properly.
for ($i = 0; $i scalar(@EMAIL_LIST);$i++){
$smtp =
Rubinow, Larry wrote:
Cleaner and easier would be
if( grep {/^$code$/} qw(APM CHN CN MN N NP NPR NRN NS
PMD RNR SCI) )
I think you want /^\Q$code\E$/, or else A.M will work, or probably also
\w+ .
Cheers,
Philip
___
Perl-Win32-Users
Charles Maier wrote:
check the filesize. If it is being written as a new file...
its size will be reported as 0 bytes.
Are you sure? When my FTP client is downloading a file, I can see the file
size in Windows Explorer or Servant Salamander (a Norton Commander clone)
increasing as more and
$Bill Luebkert wrote:
open OUT, "$filename" or die ...
print OUT ...
close OUT;
And if Scott wants to reopen STDOUT just to avoid having to type "print OUT
blabla" all the time, there's still one-arg select:
open OUT, "$filename" or die ...
select(OUT);
print
Lee wrote:
There follows some i/o from the same input string, an HTML file
which as ben subject to join //,@html; and s/[\r\f\0\n]/ /g;
Completely unrelated, but what the hey -- do you read in the file as @html =
FILE and then $string = join '', @html? Why not read the file into $string
byron wise wrote:
I am able to send mail using Sendmail with no prob. But now I want to
insert html tags to change color of text, make things bold,
even give a background color. When I put them in as I would
imagine the tags show up in the body..not rendered at all. Is
there a fix?
barons wrote:
I have my Perl script set up to page through recordsets. 10
pages at a time. My SQL call is something like this.
SELECT column1, column2 FROM table.
Now each time the next or prev button is pressed this SQL
call is executed and searches through the table to find where
it
Lee wrote:
What is the best means you found of running a diff
on two text files to return differences/locations of?
This is under Perl5.6, Win98/2000, and time preasure.
Not the best, but using native tools: "fc" is a fairly minimal diff-like
tool which you might be able to use. Try saying
Hi,
I'd like to have Unicode::String added to the 522 PPM repository. I believe
builds 6xx have Unicode support already, but I'm still using 522 here, and
would like to use this module; however, it includes an XS component.
Thanks a lot!
Cheers,
Philip
How can I get German characters such as ä ö ü into LDAP using the
module Net::LDAP (from the ActiveState packet perl-ldap 0.17 -- *not*
PerLDAP!).
What happens when I try to insert a string containing a non-ASCII
character is that the string is truncated at that point. For example,
if I try to
[Also posted to Perl-Win32-Users]
[Mike, please don't post in HTML :)]
Nolen, Mike wrote:
Thanks Philip. It works great.
I do have one more problem though. I am calling the article()
function from NNTP and it returns a reference to an array.
You said a reference is a scalar, therefore, I
erskine, michael wrote:
-Original Message-
From: Martin Moss [mailto:[EMAIL PROTECTED]]
Everyone,
I'm curious to other people's viewpoints regarding the html
email's issue.
My viewpoint: Let's have a ban on html postings.
I agree :). And encourage good quoting (your
Asif Kaleem wrote:
I don't want to use File::Basename.
Why not?
It's supposedly been tried and tested; no need to re-invent the wheel (and
maybe get it wrong).
Cheers,
Philip
___
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
65 matches
Mail list logo