marine subroutine



i am trying to figure out how to use the subroutine in a library now.

so I did this.

I name one script sub.pl and the library sub-lib-pl:

the script.pl contains:

#!/usr/bin/perl

use strict;

require 'sub-lib.pl';


marine();

The sub-lib.pl contains:


#!/usr/bin/perl

sub marine {
$n += 1; #Global variable $n
print "Hello, sailor number $n!\n";
}


I get the error:

sub-lib.pl did not return a true value at ./sub.pl line 5.

Why is that? The value is 1 isn't it?


Relevant Pages

  • Re: Word 2004 VBA -> Applescript
    ... That sounds like a reason in itself for trying out AppleScript Studio. ... the main script file and call out to "action" handlers in another script ... subroutines, from tiny to small (my find & replace subroutine is the largest ... The truth is, despite the difficulty of working with VBA on the Mac, I ...
    (microsoft.public.mac.office.word)
  • Re: Javascript Confirm()
    ... need to display a confirmation alert to user. ... Below is the script I'm using in the Submit_Clicksubroutine. ... Dim strScript As String = "<script ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: MsgBox Timeout
    ... "S Moran" wrote: ... actually a subroutine even though I haven't defined it as a subroutine? ... So what I am doing is writing a login script for our company and part ... strMsg & VbCrLf &_ ...
    (microsoft.public.scripting.vbscript)
  • Re: The system cannot find the batch label specified
    ... "The system cannot find the batch label specified - RunReports" ... I've written quite an extensive shell script that uses multiple "call ... call:Log SUBSTART STARTING:RunReports SUBROUTINE ...
    (microsoft.public.win2000.cmdprompt.admin)
  • Re: Linking/Placing different texts in one text document to the right document by giving these p
    ... I'm a novice scripter so not the best judge, but I don't think the script you describe would be easy to write, and it would require you to be absolutely consistent in some ways that might get annoying. ... Eg. if the document is named "Ideas about Sailors" and your heading was "Sailor Idea", the script might fail, although a human, or a search on "Sailor" in one of the alternate programs I recommended, would connect those two things with no problem. ...
    (microsoft.public.mac.office.word)