The file handle NEWQUOTES isn't in scope inside the subroutine.

Search the perlfaq for 'How can I make a filehandle local to a subroutine?'
e.g. perldoc -q 'filehandle local to a subroutine'


--Josh


----- Original Message -----
From: "Scott" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, January 10, 2002 10:39 AM
Subject: Manageable code


> I admit I am a newbie and making this harder than it really is :)  But, I
> have a program that is growing by the minute and I want to split it apart
> into chunks or sub routines.
>
> Here is an example:
>
> sub init_type_99{
> print NEWQUOTES "99"; #RecordType
> printf NEWQUOTES ("%08d", "1"); #FileBatchTotal
> printf NEWQUOTES ("%08d", $count-1); #TotalRecords
> printf NEWQUOTES ("%-237s"); #RecordFiller
> print NEWQUOTES "\n";
> }
>
> Yet when I call the sub doing this:
>
> init_type_99();
> I do not get the results I was looking for.  Is it a bad idea to do a sub
> like this and reserve it to only return a value?
>
> Thanks,
>
> -Scott
>
>
>
> --
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>



-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to