i always failed use return in perl when i making program.....altought i follow the book to make script.....what happen....
Code:#!/usr/bin/perl -w print jumlah(2,3),"\n"; print jumlah(5,4),"\n"; sub jumlah() { ($arg_1,$arg_2) = @_; return($arg_1+$arg_2); }
i use geany for making script...that have an error in return...help for repaire
Note I removed the parentheses after the subroutine name. Add them and run the code again and you will get a warning from perl. Warnings are different than errors.Code:#!/usr/bin/perl #look these three pragmas up in the perl documentation use warnings; use diagnostics; use strict; print jumlah(2,3),"\n"; print jumlah(5,4),"\n"; sub jumlah { my ($arg_1,$arg_2) = @_; return($arg_1 + $arg_2); }
ok thanks i will try 1st
wow nice n success.....
but i dont understan to using modul.....ive read but i don have an example for that
Last edited by WingedPanther; 07-02-2009 at 06:48 AM. Reason: Double post
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks