CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Beginner: Beginning perl; subroutines: Edit Log

New User

Nov 29, 2012, 11:05 AM

Views: 2560
Beginning perl; subroutines

Hey guys,

So I again, I come to the forums looking for programming guidance. The language that I'm specifically trying to work with today is Perl. So pretty much for my class we're being asked to read in from a file, print out to a new file and use a sub routine for the program. With my knowledge of other programming languages (very limited mind you) I got everything done, except for my sub routine.

My subroutine is supposed to from the read in file take the input for example 21-Nov-1995 and break down the whole numbers into digits and then provide some computations.

so for example 21 = 2 and 1, Nov would be 1 and 1 etc etc.

After reading the chapters this project is supposed to cover I've found not one way to split the digits apart. to be honest the only way I can personally think of based on my past classes would be using a delimiter and even then we haven't covered that in this class yet. So I guess there's a way to do it otherwise?

Any guidance of just how to split up my whole number would be really appreciated (any method or example would do honesty).

Thanks, Shevik

(This post was edited by shevik on Nov 29, 2012, 11:31 AM)

Edit Log:
Post edited by shevik (New User) on Nov 29, 2012, 11:31 AM

Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives