- Perl Basics
- Perl - Home
- Perl - Introduction
- Perl - Environment
- Perl - Syntax Overview
- Perl - Data Types
- Perl - Variables
- Perl - Scalars
- Perl - Arrays
- Perl - Hashes
- Perl - IF...ELSE
- Perl - Loops
- Perl - Operators
- Perl - Date & Time
- Perl - Subroutines
- Perl - References
- Perl - Formats
- Perl - File I/O
- Perl - Directories
- Perl - Error Handling
- Perl - Special Variables
- Perl - Coding Standard
- Perl - Regular Expressions
- Perl - Sending Email
- Perl Advanced
- Perl - Socket Programming
- Perl - Object Oriented
- Perl - Database Access
- Perl - CGI Programming
- Perl - Packages & Modules
- Perl - Process Management
- Perl - Embedded Documentation
- Perl - Functions References
- Perl Useful Resources
- Perl - Questions and Answers
- Perl - Quick Guide
- Perl - Useful Resources
- Perl - Discussion
Perl reset Function
Description
This function resets (clears) all package variables starting with the letter range specified by EXPR. Generally only used within a continue block or at the end of a loop. If omitted, resets ?PATTERN? matches.
Variables that have been declared using the my() function will not be reset.
Using reset() can reset system variables you may not want to alter-like the ARGV and ENV variables.
Syntax
Following is the simple syntax for this function −
reset EXPR reset
Return Value
This function returns 1.
Example
Following is the example code showing its basic usage −
#!/usr/bin/perl -w my $var = 10; $van = 5; print "Var value = $var, Van value =$van\n"; # Now reset all variables who name starts with 'v' reset('v'); print "Var value =$var, Van value =$van\n";
When above code is executed, it produces the following result −
Var value = 10, Van value = 5 Var value = 10, Van value =
perl_function_references.htm
Advertisements