Pre-declare $data, $text with my before the format and it should clear up for
you.
Wags ;)
-----Original Message-----
From: David Anderson [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, March 20, 2002 07:58
To: [EMAIL PROTECTED]
Subject: Strict is driving me mad
Hello All,
I am trying to set up formatted printing and seem to be blocked by use
strict.
Code below produces the following errors, so could someone be kind
enough to explain why they occur (and more particularly how one should
write formatted printing)?
Errors:
Use of comma-less variable list is deprecated at line 5.
Global symbol "$text" requires explicit package name at line 5.
Global symbol "$data" requires explicit package name at line 5.
Bareword LINE not allowed while "strict subs" in use
Code:
#!/usr/bin/perl -w
use strict;
format LINE =
@<<<<<<<<<<<<<<<<<<@<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
$text, $data
.
&PrintStd ("Text", "This is the data");
sub PrintStd() {
my ($text, $data) = @_;
$~ = LINE;
write;
}
--
Best regards,
David
David Anderson mailto:[EMAIL PROTECTED]
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
_______________________________________________
ActivePerl mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs