pub struct PerlModernizer {}Expand description
Analyzes and modernizes legacy Perl code patterns.
Detects outdated idioms and suggests modern alternatives following Perl best practices.
Implementations§
Source§impl PerlModernizer
impl PerlModernizer
Sourcepub fn new() -> PerlModernizer
pub fn new() -> PerlModernizer
Creates a new PerlModernizer instance.
Sourcepub fn analyze(&self, code: &str) -> Vec<ModernizationSuggestion>
pub fn analyze(&self, code: &str) -> Vec<ModernizationSuggestion>
Analyzes Perl code and returns a list of modernization suggestions.
Detects patterns such as bareword filehandles, two-argument open, indirect object notation, and deprecated built-in usages.
Sourcepub fn apply(&self, code: &str) -> String
pub fn apply(&self, code: &str) -> String
Applies safe modernization suggestions to the given code.
Suggestions marked as requiring manual review are skipped. Returns the modernized code as a new string.
Sourcepub fn modernize_file(
&mut self,
file: &Path,
_patterns: &[ModernizationPattern],
) -> Result<usize, ParseError>
pub fn modernize_file( &mut self, file: &Path, _patterns: &[ModernizationPattern], ) -> Result<usize, ParseError>
Modernize a Perl file on disk based on specified patterns
Trait Implementations§
Source§impl Default for PerlModernizer
impl Default for PerlModernizer
Source§fn default() -> PerlModernizer
fn default() -> PerlModernizer
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PerlModernizer
impl RefUnwindSafe for PerlModernizer
impl Send for PerlModernizer
impl Sync for PerlModernizer
impl Unpin for PerlModernizer
impl UnsafeUnpin for PerlModernizer
impl UnwindSafe for PerlModernizer
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more