I've got a program that works well. It parses a text file and, using a list of keywords and rules, it splits the text file in differents files. Each of these files contain a part of the original text file. This program uses an array that contains the original text file.
This program will be used often in my project so I decided to create a subroutine and put it in a module.
The problem is when I call this program as a subroutine from an other one, the file creation doesn't work i.e they are not created correctly as when running the program directly as a "standalone"...
I thought that the array might be modified when passed to the @_ one in the subroutine. But if I print it line by line within the subroutine it looks OK.
I have tried to pass the array as a reference but it doesn't seem to work either (although I have to admit I am not an expert in doing this).
Could someone help me with this issue ?
This program will be used often in my project so I decided to create a subroutine and put it in a module.
The problem is when I call this program as a subroutine from an other one, the file creation doesn't work i.e they are not created correctly as when running the program directly as a "standalone"...
I thought that the array might be modified when passed to the @_ one in the subroutine. But if I print it line by line within the subroutine it looks OK.
I have tried to pass the array as a reference but it doesn't seem to work either (although I have to admit I am not an expert in doing this).
Could someone help me with this issue ?