Question
Can someone help me with my Perl script? For some reason, open($info, >info.txt) clears the file but fails to write the data into it. I've
Can someone help me with my Perl script? For some reason, open($info, ">info.txt") clears the file but fails to write the data into it. I've used an array of methods for writing into the file, and even the append and "+" combinations fail to work. The "append" methods don't even write into the file at all. I've even used ">>", "+>", and "+>>" with no luck. The "w", "r", and "a" always gives me this: Can't open data at /cygdrive/c/Users/admin/Desktop/a14.pl line 11, line 3.
The current script I've attached to this message results in the following output: ------------------------------------------------------------------------------- admin@Dell /cygdrive/c/users/admin/desktop $ perl /cygdrive/c/Users/admin/Desktop/a14.pl
Full Name: Firstname Lastname
Age: 30
Gender: Female
Marital Status: Single
Do you want to change the age? (Y/y or N/n): y What is the new age? 27
Do you want to change the Marital Status? (Y/y or N/n): n The result is: Full Name: Age: Gender: Marital Status: admin@Dell /cygdrive/c/users/admin/desktop $ perl /cygdrive/c/Users/admin/Desktop/a14.pl
Full Name: Age: Gender: Marital Status:
Do you want to change the age? (Y/y or N/n):
admin@Dell /cygdrive/c/users/admin/desktop $
-------------------------------------------------------------------------------
Here's the script -------------------------------------------------------------------------------
#!/usr/bin/perl open(DATA,"
open(DATA,"
Is it because Cygwin's incompatible? Is it the script itself? I don't know if it's a software issue, an error in my script, or if it's my system. Is there any advice or tips that you can provide? Thank you.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started