=$mw-Entry(-width, 60, -textvariable, \$author)-pack;$author=;MainLoop;#
___Perl-Win32-Users mailing listPerl-Win32-Users@listserv.ActiveState.comTo unsubscribe:
http://listserv.ActiveState.com/mailman/mysubs-- Ron Hartikka[EMAIL PROTECTED
If you...
@the_data = ();
... then @the_data will be empty.
Is that what you want?
(When you say, ...clear everything out - reinitialize it so it is
'fresh'., you have failed to say what you want in 3 different ways.)
Ron
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL
This is tested. Perl Cookbook Recipe 4.15. Sorting a List by Computable
Field
The date from stat is probably not what you want.
-
my $dir = 'C:\data\perl\programexamples'; change to your
dir
$|=1;
opendir(DIR, $dir) || die cant opendir $dir: $!;
my @files =
Unless I've been unfair, for small dirs, no_shwartz wins; for big dirs
(~3000 files?), schwartz wins.
Looks like you want to reserve schwartz for where calculating the value to
sort by is more expensive than a hash lookup or where you have more than
~3000 elements elements.
Maybe somebody could
Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Joseph P. Discenza
Sent: Tuesday, January 29, 2002 2:54 PM
To: Ron Hartikka; [EMAIL PROTECTED]
Subject: RE: Q: How to sort Array of Hashes
Ron Hartikka wrote, on Tuesday, January 29, 2002 2:40 PM
: Unless I've been
try
$counter-update;
after
$counter-configure(-text=$i);
My guess is
you are going to want to look at Tk's 'after' method.
-Original Message-From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
robozSent: Monday, January 21, 2002 11:01 AMTo:
[EMAIL
Seems like a
hard way to program! But, maybe it's right for your
situation.
Please post
more if you can.
What do you
mean by "it didn't work"?
Try printing
the values returned by eval() - undefined value messageindicates bad
code.
-Original Message-From:
text. Ugh.
-Original Message-From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Venkataramana MokkapatiSent: Tuesday, January 15, 2002 9:16
AMTo: Ron Hartikka; thiyag; perl-win32-users Mailing
ListSubject: Re: problem with eval
d
Works but not if you have more or fewer than 2 values in a row.
Do you?
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Wagner-David
Sent: Thursday, January 10, 2002 1:31 PM
To: 'Gordon Brandt'; [EMAIL PROTECTED]
Subject: RE: Regex Help Please!
As far as I know, perl does not free memory (back to the system); you can
never shrink.
You can avoid getting too big in the first place.
You can restart (exec) yourself if you get to big.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
sunil matte
as if as if you wrote...
$values[2] = \$hash{\$x}{\$y}{'value'}; # contents is a string, not a ref
to a hash
What you plan to do with the string \$hash{\$x}{\$y}{'value'}?
-Original Message-
From: Ed DeBus [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 04, 2001 12:31 PM
To: Ron Hartikka
for $number (1006326869812, 563296853235993 , 35968322963568389){
print $1-$2-$3\n if ($number =~ /(\d*)(\d{4})(\d{5})/);
}
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
[EMAIL PROTECTED]
Sent: Thursday, November 29, 2001 3:32 PM
To:
Do you have the file open?
You cannot delete an open file according to Bill.
open (JUNK, 'junkyfile.txt');
print JUNK STUFF IN junkyfile.txt\n;
close JUNK;
print `type junkyfile.txt`;
unlink 'junkyfile.txt';
print `type junkyfile.txt`;
... prints...
STUFF IN junkyfile.txt
The system cannot
I started task mgr manually. This worked. w2k.
use Win32::GuiTest qw(FindWindowLike GetWindowText SetForegroundWindow
SendKeys);
$Win32::GuiTest::debug = 0; # Set to 1 to enable verbose mode
my @windows = FindWindowLike(undef, Windows Task Manager, .);
#print join \n, @windows;
for
Just remove the debug statements once and put them in a second script to be
exec'd based on command line parameter.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Nick Djurovich
Sent: Monday, November 12, 2001 12:45 PM
To: PERLMAILINGLIST
I have:
[EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED]; [EMAIL PROTECTED];
I want an Outlook distribution list with these addresses.
Outlook makes me do them one at a time.
Can you do this in perl? If so how?
Thanks.
___
Perl-Win32-Users
Could you clarify the question.
Example: If I get the input line
___
I want this output line
___.
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Dan
Jablonsky
Sent: Monday, June 18, 2001 2:32 PM
To: [EMAIL PROTECTED]
Subject: computations with
Same with scalars...
our $s1 = a;
my %s2 = b;
our $s3 = c;
for my $it (qw(s1 s2 s3)){
print $it: $$it\n;
}
... prints...
Name main::s1 used only once: possible typo at scalersymref.pl line 2.
Name main::s3 used only once: possible typo at scalersymref.pl line 4.
Use of uninitialized
Charles,
Can the () in your data be nested?
If so, you can't use an re. (See: How do I find matching/nesting anything?
in perlfaq 4.) For example,
while (DATA){
print;
print becomes\n;
s/\([^\)]+\)/()/g; # as Bill suggests
print;
print \n;
}
__DATA__
asdf(as(asdf)df)asdf
becomes
asdf(as()df)asdf
- so, while what? -
-Original Message-
From: Joseph P. Discenza [mailto:[EMAIL PROTECTED]]
Sent: Thursday, June 07, 2001 8:53 AM
To: Ron Hartikka; perl win32 users
Subject: RE: RegEx: Finding and replacing all characters
You could use two, a function, instead of $two a scalar...
for $one qw(a b c d){
print two();
}
sub two{isn't this a nice $one!\n}
prints...
isn't this a nice a!
isn't this a nice b!
isn't this a nice c!
isn't this a nice d!
But, it's not pretty to embed the function call in a print
When I say, But, it's not pretty to embed the function call in a print
statement, I mean you can't put a function call in a scalar. You can put it
in the list to print.
I haven't tried it, but I think you can put a tied scalar in a scalar and
get the tied behavior, which is what you want.
Try this...
use strict;
my @list = ("a=1","b=2","c=3");
my %hash = map { my @elt = split /=/, $_; $elt[0] = $elt[1]} @list;
for (keys %hash) {
print "\$hash{$_} = $hash{$_}\n";
}
which prints
$hash{a} = 1
$hash{b} = 2
$hash{c} = 3
You have to split a scalar; you cannot split
Title: Re: Rounding numbers
use POSIX;
$ceil = ceil(3.5); # 4
From perlfaq4.
-Original Message-From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of
Alloun, JonathanSent: Wednesday, February 14, 2001 6:54
AMTo: [EMAIL PROTECTED]Subject:
Careful!
I think you're saying you want to base your choice on the numeric part of
the name - "the latest file".
Yet, you apply the sort function to the whole name!
Note that 'OZ365.log' sorts in front of 'Oz001.log' (because of z vs. Z).
Maybe you want to capture the \d\d\d in the filenames
At http://www.perl.com/pub/language/info/software.html, you find 2
distributions: stable.zip for Microsoft and stable.tar.gz for everyone else.
My copy of stable.tar (from October) doesn't seem to have OLE.pm in it
since...
%tar tf stable.tar|grep OLE
...gives me nothing.
-Original
This code:
$file="c:\\attain\\attainc.exe";
$rec = `cat $file`;
print $rec;
ran on my machine (win98). I may have a cat from Hummingbird software.
But, the code also worked with 'type' (native to dos) instead of 'cat'.
I don't think you can pass an open file handle to
Sounds like you want your error window to do a grab. The main window of this
prog has 2 buttons. One to print 'Hello' and one to raise a second window by
calling sub do_toplevel. The grab in sub do_toplevel makes $tL modal, i.e.
no buttons on $mw will work until $tL is closed. Try pressing the
Merrill, you mean "set up exception handlers", not "step up", right? (Could
confuse newbie.)
Also, why not mention using 'return' to "escape" from a function? You can
use 'return' any
And, Dave, you can should read about 'return' in the perlsub manpage and
about 'die' in the perlfunc manpage.
Doug,
for (0..23) {printf "%02.f ", $_}
prints
00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21 22 23
You may want to use sprintf:
for (0..23) {$a .= sprintf "%02.f ", $_; }
print $a;
prints the same thing.
Hope this helps.
-Ron
-Original Message-
From: [EMAIL
$old_umask = umask 000; # was 022 for example which would turn 0777 into
0755
$log_directory = "junky";
# you need the leading 0 in "0777" below to make the number hex
unless (-d "$log_directory") {
mkdir ("$log_directory", 0777) or die ("Cannot create log_directory.
$log_directory.
# the rest of the story (tested)
use Fcntl; # gets the constants like O_WRONLY
$old_umask = umask 000; # was 022 for example which would turn 0777 into
$log_directory = "junky";
unless (-d "$log_directory") {
mkdir ("$log_directory", 0777) or die ("Cannot create log_directory.
32 matches
Mail list logo